升级到 16.10 错误

升级到 16.10 错误

我尝试升级到 16.10,但升级过程中崩溃了。现在,每当我尝试更新任何内容时都会收到错误。

uname -r输出4.4.0-53-generic

这是我执行任何 apt-get 命令时遇到的错误sudo apt-get upgrade -f

Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 251316 files and directories currently installed.)
Removing linux-image-extra-4.4.0-51-generic (4.4.0-51.72) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-51-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
Error! Your kernel headers for kernel 4.4.0-51-generic cannot be found.
Please install the linux-headers-4.4.0-51-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-51-generic /boot/vmlinuz-4.4.0-51-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-51-generic
/usr/sbin/mkinitramfs: 66: .: Can't open /etc/initramfs-tools/initramfs.conf
update-initramfs: failed for /boot/initrd.img-4.4.0-51-generic with 2.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 2
dpkg: error processing package linux-image-extra-4.4.0-51-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.4.0-51-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

作为一个没有经验的 Linux 用户,我该怎么做才能修复这个错误?

答案1

尝试这个:

sudo apt-get update
sudo apt-get install --reinstall linux-headers-4.4.0-51-generic
sudo apt-get -f install
sudo apt-get dist-upgrade

请注意,如果您手动安装或编译了任何内核模块,则在安装了新内核版本时,您将需要为新内核版本重新编译模块。

相关内容