更新期间出现内核错误的问题


-1

使用标准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)

1
这些消息都与最旧的内核有关,所以不要害怕(检查一下,uname -r 我猜它将返回4.4.0-24-generic,新内核)显然,这个旧内核已经被(部分删除了)(很好),--fix-missing并试图再次删除它。运行sudo apt autoremove或仅重新启动可能会使情况平静下来。如果不是这样,您可能必须手动删除一些与旧内核有关的文件,这很容易做到。
詹娜(Janna)2013年

您是否已解决此问题?
Zanna 2016年

Answers:


1

在运行之前apt-get install -f,请先查看内核软件包的postinst脚本是否已完成其设置。为此,请执行以下操作:

sudo /var/lib/dpkg/info/linux-image-extra-4.4.0-21-generic.postinst configure

我认为,这应该在尝试删除软件包之前完成postinst流程。


0

我看你用 /etc/default/grub: i915.preliminary_hw_support=1:

这是针对某些错误(由AskUbuntu用户建议的)的修复程序,但同时也弄乱了升级过程。只需从grub文件中删除该行,然后重新启动,就可以了。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.