内核升级后,dpkg/dkms 不会退出/挂起

内核升级后,dpkg/dkms 不会退出/挂起

我已经升级到最新的内核版本。

升级过程未完成。手动尝试(在终端上)时,我得到:

Setting up linux-image-4.13.0-25-generic (4.13.0-25.29) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.13.0-25-generic
vmlinuz(/boot/vmlinuz-4.13.0-25-generic
) points to /boot/vmlinuz-4.13.0-25-generic
 (/boot/vmlinuz-4.13.0-25-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.13.0-25-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.13.0-25-generic /boot/vmlinuz-4.13.0-25-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.13.0-25-generic /boot/vmlinuz-4.13.0-25-generic
(hangs)

我尝试按照评论中的建议删除 nvidia 驱动程序和内核映像。但这基本上会导致同样的问题:

$ sudo apt-get purge linux-image-4.13.0-25-generic *nvidia*
The following packages will be REMOVED:
  linux-image-4.13.0-25-generic* linux-image-extra-4.13.0-25-generic nvidia-384* nvidia-opencl-icd-384* nvidia-prime*
  nvidia-settings*
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 235 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 210977 files and directories currently installed.)
Removing linux-image-extra-4.13.0-25-generic (4.13.0-25.29) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.13.0-25-generic /boot/vmlinuz-4.13.0-25-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.13.0-25-generic /boot/vmlinuz-4.13.0-25-generic
(hangs)

答案1

对我来说,这与专有的 nvidia 驱动程序(版本 385)有关。我使用“软件和更新 -> 附加驱动程序”选项卡将其删除。之后,我linux-image-4.13.0-25-generic使用以下命令手动卸载了该软件包:

sudo apt-get remove linux-image-4.13.0-25-generic

然后跑了:

sudo apt-get install -f && sudo apt-get upgrade

重新启动后,我的系统运行最新的内核,并且我能够安装最新的 nvidia 驱动程序。

编辑:

如果进程挂起,显然终止plymouth服务应该会有所帮助(参见发射台)在新的终端中输入

sudo pkill plymouth

安装将继续进行。

编辑2:

正如/op 提到的,在一切恢复正常后重新安装linux-image-generic软件包以将内核更新到最新版本:

sudo apt-get install linux-image-generic

相关内容