![无法在 Ubuntu 16.04 上更新内核“dpkg:处理包时出错”](https://linux22.com/image/715757/%E6%97%A0%E6%B3%95%E5%9C%A8%20Ubuntu%2016.04%20%E4%B8%8A%E6%9B%B4%E6%96%B0%E5%86%85%E6%A0%B8%E2%80%9Cdpkg%EF%BC%9A%E5%A4%84%E7%90%86%E5%8C%85%E6%97%B6%E5%87%BA%E9%94%99%E2%80%9D.png)
我想更新我在云主机上使用的 Ubuntu VM 的内核,该内核目前停留在 2.6 版本。我在桌面上使用 Arch Linux,因此我习惯于我的包管理器每隔几天给我提供内核更新作为更新常规包的一部分,所以我希望运行“apt-get upgrade”可以解决这个问题。但当它完成后,我仍然在 2.6 版本。我发现这一页建议我使用以下命令安装一些软件包:
sudo apt-get install --install-recommends linux-generic-hwe-16.04
现在,当我尝试安装该软件包时,我收到以下消息。我尝试在 Google 上搜索解决方案,但没有找到。
root@server:~# sudo apt-get install --install-recommends linux-generic-hwe-16.04
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-generic-hwe-16.04 is already the newest version (4.10.0.42.44).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
4 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.10.0-42-generic (4.10.0-42.46~16.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.10.0-42-generic
vmlinuz(/boot/vmlinuz-4.10.0-42-generic
) points to /boot/vmlinuz-4.10.0-42-generic
(/boot/vmlinuz-4.10.0-42-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.10.0-42-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-42-generic /boot/vmlinuz-4.10.0-42-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-42-generic /boot/vmlinuz-4.10.0-42-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-42-generic
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.10.0-42-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.10.0-42-generic.postinst line 1052.
dpkg: error processing package linux-image-4.10.0-42-generic (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-4.10.0-42-generic:
linux-image-extra-4.10.0-42-generic depends on linux-image-4.10.0-42-generic; however:
Package linux-image-4.10.0-42-generic is not configured yet.
dpkg: error processing package linux-image-extra-4.10.0-42-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic-hwe-16.04:
linux-image-generic-hwe-16.04 depends on linux-image-4.10.0-42-generic; however:
Package linux-image-4.10.0-42-generic is not configured yet.
linux-image-generic-hwe-16.04 depends on linux-image-extra-4.10.0-42-generic; however:
Package linux-image-extra-4.10.0-42-generic is not configured yet.
dpkg: error processing package linux-image-generic-hwe-16.04 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-hwe-16.04:
linux-generic-hwe-16.04 depends on linux-image-generic-hwe-16.04 (= 4.10.0.42.44); however:
Package linux-image-generic-hwe-16.04 is not configured yet.
dpkg: error processing package linux-generic-hwe-16.04 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-4.10.0-42-generic
linux-image-extra-4.10.0-42-generic
linux-image-generic-hwe-16.04
linux-generic-hwe-16.04
E: Sub-process /usr/bin/dpkg returned an error code (1)
这是我在解决与我的问题类似的问题的帖子中找到的命令的输出:
root@server:~# dpkg -l | grep linux-image*
iF linux-image-4.10.0-42-generic 4.10.0-42.46~16.04.1 amd64 Linux kernel image for version 4.10.0 on 64 bit x86 SMP
iU linux-image-extra-4.10.0-42-generic 4.10.0-42.46~16.04.1 amd64 Linux kernel extra modules for version 4.10.0 on 64 bit x86 SMP
iU linux-image-generic-hwe-16.04 4.10.0.42.44 amd64 Generic Linux kernel image