更新 ubuntu 内核时出现问题

问题描述 投票:0回答:2

我已在 Virtual Box 上安装了 Ubuntu 16.04.4 LTS。我在更新内核时遇到一些问题,我不知道如何修复它们!阅读我尝试过的其他答案

sudo apt-get update

sudo apt-get upgrade

这就是报告

Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze       
Lettura informazioni sullo stato... Fatto
Calcolo dell'aggiornamento... Fatto
I seguenti pacchetti saranno RIMOSSI:
linux-image-extra-4.10.0-28-generic
0 aggiornati, 0 installati, 1 da rimuovere e 0 non aggiornati.
5 non completamente installati o rimossi.
Dopo quest'operazione, verranno liberati 156 MB di spazio su disco.
Continuare? [S/n] S
(Lettura del database... 232826 file e directory attualmente installati.)
Rimozione di linux-image-extra-4.10.0-28-generic (4.10.0-28.32~16.04.2)...
depmod: ERROR: failed to load symbols from /lib/modules/4.10.0-28-generic/misc/vboxvideo.ko: Invalid argument
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
Error! Your kernel headers for kernel 4.10.0-28-generic cannot be found.
Please install the linux-headers-4.10.0-28-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-28-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
run-parts: executing /etc/kernel/postinst.d/vboxadd 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
run-parts: failed to exec /etc/kernel/postinst.d/vboxadd: Exec format error
run-parts: /etc/kernel/postinst.d/vboxadd exited with return code 1
dpkg: errore nell'elaborare il pacchetto linux-image-extra-4.10.0-28-generic (--remove):
il sottoprocesso installato script di post-removal ha restituito lo stato di errore 1
Si sono verificati degli errori nell'elaborazione:
linux-image-extra-4.10.0-28-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

谢谢大家的帮助!

ubuntu kernel virtualbox
2个回答
1
投票

解决了!我按照本网站的说明设法修复了我的内核问题(我已经删除了 var/lib/dpkg/status 中损坏的软件包的引用)。

这里有答案的网站

https://askubuntu.com/questions/1014322/how-to-fix-configuration-issues-of-an-old-kernel-in-order-to-make-upgrade-possib


0
投票

即使 TO 能够解决问题,我还是想建议一种对我来说更简单的方法,并避免修改 dkpg 管理器文件的麻烦。也许先尝试一下是值得的,而且危险性较小。

最近,我在虚拟机上遇到了类似的问题。 apt 拒绝更新或安装任何带有以下错误消息的软件包:

    ...
    /etc/kernel/postinst.d/vboxadd:
    run-parts: failed to exec /etc/kernel/postinst.d/vboxadd: Exec format error
    run-parts: /etc/kernel/postinst.d/vboxadd exited with return code 1
    ...

我的虚拟机上的文件 /etc/kernel/postinst.d/vboxadd 是空的。这让我想到 VirtualBox GuestAdditions 被破坏了。事实上,在简单地重新安装 GuestAdditions 后,问题就消失了。

© www.soinside.com 2019 - 2024. All rights reserved.