半安装的软件包噩梦 - 如何修复?

半安装的软件包噩梦 - 如何修复?

我最近(尝试)更新我的 Linux Mint(18.3,x64)系统。一切顺利,但我在linux-image-extra-4.13.0-41-generic和 的配置脚本中遇到了错误linux-image-extra-4.13.0-41-generic。有一段时间,我可以安装其他软件包,但在尝试删除它们后,我无法再安装任何东西。为了删除它们,我尝试过:

 sudo apt remove linux-image-extra-4.13.0-41-generic linux-image-extra-4.13.0-41-generic
 sudo apt purge linux-image-extra-4.13.0-41-generic linux-image-extra-4.13.0-41-generic
 sudo apt install -f
 sudo dpkg --remove --force-remove-reinstreq --dry-run linux-image-extra-4.13.0-41-generic linux-image-extra-4.13.0-41-generic
 sudo dpkg --remove --force-remove-reinstreq linux-image-extra-4.13.0-41-generic linux-image-extra-4.13.0-41-generic

他们都没有移除包裹。

我在尝试安装软件包时也得到了这个:

Removing linux-image-extra-4.13.0-41-generic (4.13.0-41.46~16.04.1) ...
depmod: FATAL: could not load /boot/System.map-4.13.0-41-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.13.0-41-generic /boot/vmlinuz-4.13.0-41-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.13.0-41-generic /boot/vmlinuz-4.13.0-41-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.13.0-41-generic /boot/vmlinuz-4.13.0-41-generic
update-initramfs: Generating /boot/initrd.img-4.13.0-41-generic
Warning: No support for locale: en_US.utf8
depmod: WARNING: could not open /var/tmp/mkinitramfs_3hnLlc/lib/modules/4.13.0-41-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_3hnLlc/lib/modules/4.13.0-41-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.13.0-41-generic /boot/vmlinuz-4.13.0-41-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.13.0-41-generic /boot/vmlinuz-4.13.0-41-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 64
dpkg: error processing package linux-image-extra-4.13.0-41-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.13.0-41-generic (4.13.0-41.46~16.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.13.0-41-generic /boot/vmlinuz-4.13.0-41-generic
update-initramfs: Deleting /boot/initrd.img-4.13.0-41-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.13.0-41-generic /boot/vmlinuz-4.13.0-41-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 64
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.13.0-41-generic.postrm line 330.
dpkg: error processing package linux-image-4.13.0-41-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.13.0-41-generic
 linux-image-4.13.0-41-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

除了重装系统之外,我没有什么办法。

还有其他想法可以强制删除这个包吗?

相关内容