不小心删除了内核文件

不小心删除了内核文件

我的启动分区已满,因此我手动删除了启动分区中的一些内核文件。然而,我很愚蠢,也删除了我真正需要的文件。

现在,当我尝试运行时,sudo apt-get upgrade我得到以下信息:

appliance@zabbix:/boot$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up linux-image-4.4.0-137-generic (4.4.0-137.163) ...
Internal Error: Could not find image (/boot/vmlinuz-4.4.0-137-generic)
dpkg: error processing package linux-image-4.4.0-137-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-137-generic:
 linux-image-extra-4.4.0-137-generic depends on linux-image-4.4.0-137-generic; however:
  Package linux-image-4.4.0-137-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.4.0-137-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-4.4.0-137-generic
 linux-image-extra-4.4.0-137-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
appliance@zabbix:/boot$

有谁知道如何解决这个问题?

我已经尝试过:sudo apt-get install -f输出:

appliance@zabbix:/boot$ sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-4.4.0-137-generic (4.4.0-137.163) ...
Internal Error: Could not find image (/boot/vmlinuz-4.4.0-137-generic)
dpkg: error processing package linux-image-4.4.0-137-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-137-generic:
 linux-image-extra-4.4.0-137-generic depends on linux-image-4.4.0-137-generic; however:
  Package linux-image-4.4.0-137-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.4.0-137-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-4.4.0-137-generic
 linux-image-extra-4.4.0-137-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

ps 输出uname -r

4.4.0-130-generic

答案1

刚刚修好。

第一次运行:

sudo dpkg -P --force-depends linux-image-4.4.0-137-generic

进而:

sudo apt upgrade -f

现在一切又恢复正常了!

谢谢!!

相关内容