我今天升级到了 20.04。升级过程中出现错误消息:“无法安装 linux-image-4.15.0-142-generic”。现在我执行“sudo apt autoremove”时只得到以下输出:
jumbo@jumbo-M11AD:~$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
dconf-editor libhunspell-1.6-0 libmxml-dev libprotobuf-lite10 libqt5script5 libunique-1.0-0 libupnp6 linux-generic linux-image-4.15.0-142-generic
linux-image-unsigned-4.15.0-140-generic
0 to upgrade, 0 to newly install, 10 to remove and 0 not to upgrade.
2 not fully installed or removed.
After this operation, 24.4 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 219622 files and directories currently installed.)
Removing linux-image-4.15.0-142-generic (4.15.0-142.146) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-142-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-88-generic
Found initrd image: /boot/initrd.img-5.4.0-88-generic
Found linux image: /boot/vmlinuz-4.15.0-159-generic
Found initrd image: /boot/initrd.img-4.15.0-159-generic
/etc/grub.d/bin/grubcfg_proxy: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-4.15.0-142-generic (--remove):
installed linux-image-4.15.0-142-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-4.15.0-142-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
jumbo@jumbo-M11AD:~$
我应该担心吗?该怎么办?
如有任何建议,我们将不胜感激!
编辑:NOrbet,我按照你的指示操作,结果如下:
jumbo@jumbo-M11AD:~$ sudo rm /etc/grub.d/bin/grubcfg_proxy
[sudo] password for jumbo:
jumbo@jumbo-M11AD:~$ sudo apt-get purge grub-customizer
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
hwinfo libhd21 libx86emu2
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED
grub-customizer* linux-image-4.15.0-142-generic
linux-image-unsigned-4.15.0-140-generic
0 to upgrade, 0 to newly install, 3 to remove and 0 not to upgrade.
2 not fully installed or removed.
After this operation, 21.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 219622 files and directories currently installed.)
Removing linux-image-4.15.0-142-generic (4.15.0-142.146) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-142-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-88-generic
Found initrd image: /boot/initrd.img-5.4.0-88-generic
Found linux image: /boot/vmlinuz-4.15.0-159-generic
Found initrd image: /boot/initrd.img-4.15.0-159-generic
/etc/grub.d/25_custom_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-4.15.0-142-generic (--remove):
installed linux-image-4.15.0-142-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-4.15.0-142-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
jumbo@jumbo-M11AD:~$
答案1
好的,然后删除有问题的文件
sudo rm /etc/grub.d/bin/grubcfg_proxy
sudo rm /etc/grub.d/25_custom_proxy
然后运行
sudo apt-get purge grub-customizer
sudo apt autoremove
最后更新 GRUB 菜单
sudo update-grub