autoremove 挂起内核删除

autoremove 挂起内核删除

我正在运行 Ubuntu 17.04 -4.10.0-21-generic系统提示我删除旧4.10.0-19-generic内核,但删除该部分时挂起了linux-image-extra-4.10.0-19-generic。请参阅:

(Reading database ... 235316 files and directories currently installed.)
Removing linux-image-extra-4.10.0-19-generic (4.10.0-19.21) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-19-generic /boot/vmlinuz-4.10.0-19-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-19-generic /boot/vmlinuz-4.10.0-19-generic

有什么建议吗?我尝试过重启,但仍然无法删除此包,从而无法进行任何其他安装。

答案1

有可能这种情况只是需要很长时间并且不会挂起。我遇到了类似的问题,最后在搁置了很长时间之后,我意识到它只是花了很长时间才完成,而且没有任何输出。这看起来像是挂起了,因为通常 Linux 和 apt 都很冗长,并且执行操作所花的时间大致相同。

编辑:经过进一步调查,我相信这是因为它(对我们来说不幸的是)足够智能,每次修改内核时apt autoremove都会运行,即使它是冗余的。我通过事后手动运行意识到了这一点,果然,同样漫长的等待时间。update-grubsudo update-grub

例如,这是我的自动删除的一些输出:

    Removing linux-image-extra-4.8.0-36-generic (4.8.0-36.36~16.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-36-generic /boot/vmlinuz-4.8.0-36-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-36-generic /boot/vmlinuz-4.8.0-36-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-36-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.8.0-36-generic /boot/vmlinuz-4.8.0-36-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.8.0-36-generic /boot/vmlinuz-4.8.0-36-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.8.0-36-generic /boot/vmlinuz-4.8.0-36-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.8.0-36-generic /boot/vmlinuz-4.8.0-36-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.8.0-52-generic
Found initrd image: /boot/initrd.img-4.8.0-52-generic
Found linux image: /boot/vmlinuz-4.8.0-46-generic
Found initrd image: /boot/initrd.img-4.8.0-46-generic
Found linux image: /boot/vmlinuz-4.8.0-45-generic
Found initrd image: /boot/initrd.img-4.8.0-45-generic
Found linux image: /boot/vmlinuz-4.8.0-36-generic
Found initrd image: /boot/initrd.img-4.8.0-36-generic
Found linux image: /boot/vmlinuz-4.4.0-78-generic
Found initrd image: /boot/initrd.img-4.4.0-78-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin

done
Removing linux-image-4.8.0-36-generic (4.8.0-36.36~16.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.8.0-36-generic /boot/vmlinuz-4.8.0-36-generic
update-initramfs: Deleting /boot/initrd.img-4.8.0-36-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.8.0-36-generic /boot/vmlinuz-4.8.0-36-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.8.0-52-generic
Found initrd image: /boot/initrd.img-4.8.0-52-generic
Found linux image: /boot/vmlinuz-4.8.0-46-generic
Found initrd image: /boot/initrd.img-4.8.0-46-generic
Found linux image: /boot/vmlinuz-4.8.0-45-generic
Found initrd image: /boot/initrd.img-4.8.0-45-generic
Found linux image: /boot/vmlinuz-4.4.0-78-generic
Found initrd image: /boot/initrd.img-4.4.0-78-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin

沮丧之余,我输入了一些命令(不是正确的方法,但我们都经历过……),只是为了看看事情是否会有反应。它没有。从输出“找到 memtest86+ 映像:/boot/memtest86+.bin”到“完成”大约需要 15 分钟。不知道为什么要花这么长时间,但耐心可能会有所帮助,它对我有帮助!

相关内容