使用标准ubuntu更新程序进行更新时发生错误。之后,在发送了错误报告后,我在控制台中输入了此内容。
有什么办法可以解决还是重新安装?
~ sudo apt-get -f install
[sudo] password for gary:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
linux-image-extra-4.4.0-21-generic
0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade.
8 not fully installed or removed.
After this operation, 162 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 222138 files and directories currently installed.)
Removing linux-image-extra-4.4.0-21-generic (4.4.0-21.37) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-21-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-21-generic /boot/vmlinuz-4.4.0-21-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-21-generic /boot/vmlinuz-4.4.0-21-generic
Error! Your kernel headers for kernel 4.4.0-21-generic cannot be found.
Please install the linux-headers-4.4.0-21-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-21-generic cannot be found.
Please install the linux-headers-4.4.0-21-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-21-generic /boot/vmlinuz-4.4.0-21-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-21-generic
WARNING: missing /lib/modules/4.4.0-21-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-21-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
cp: cannot stat '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf': No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-21-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-21-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-4.4.0-21-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
您是否已解决此问题?
—
Zanna 2016年
uname -r
我猜它将返回4.4.0-24-generic
,新内核)显然,这个旧内核已经被(部分删除了)(很好),--fix-missing
并试图再次删除它。运行sudo apt autoremove
或仅重新启动可能会使情况平静下来。如果不是这样,您可能必须手动删除一些与旧内核有关的文件,这很容易做到。