最近在旧机器上进行升级(16.04 -> 18.04 -> 20.04)后,我现在无法再安装任何东西,因为apt
尝试删除时遇到错误linux-image-4.4.0-190-generic
,请参阅下面的终端输出:
$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-4.4.0-190-generic
0 upgraded, 0 newly installed, 1 to remove and 53 not upgraded.
1 not fully installed or removed.
After this operation, 7.250 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 177055 files and directories currently installed.)
Removing linux-image-4.4.0-190-generic (4.4.0-190.220) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.4.0-190-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-48-generic
Found initrd image: /boot/initrd.img-5.4.0-48-generic
Found linux image: /boot/vmlinuz-4.15.0-118-generic
Found initrd image: /boot/initrd.img-4.15.0-118-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.4.0-190-generic (--remove):
installed linux-image-4.4.0-190-generic package post-removal script subprocess returned error exit s
tatus 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-4.4.0-190-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
我已经sudo apt update
事先运行过了,但sudo apt upgrade
在安装任何东西之前,由于删除时出现同样的错误而运行失败。
sudo apt autoremove
或输出中的第一个错误通知sudo apt install -f
指出了libcrypto.so.1.0.0
来自 的共享库存在问题libssl
,由于我遇到的确切问题,我无法安装该库来修复它。
我也尝试过通过--only-upgrade
结合使用来解决这个问题--reinstall libssl-dev libssl1.1
,但这并不能阻止它尝试删除 linux 镜像:
sudo apt --only-upgrade install --reinstall libssl-dev libssl1.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-4.4.0-190-generic
0 upgraded, 0 newly installed, 2 reinstalled, 1 to remove and 53 not upgraded.
1 not fully installed or removed.
Need to get 0 B/2.900 kB of archives.
After this operation, 7.250 kB disk space will be freed.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 177055 files and directories currently installed.)
Removing linux-image-4.4.0-190-generic (4.4.0-190.220) ...
[...]
我该如何删除该图像和/或修复潜在的问题?
编辑:添加了提及sudo apt update/upgrade
答案1
子目录中有可疑的二进制文件/etc/grub.d/
,尤其是grubcfg_proxy
。
此文件是grub-customizer
包裹。
因此您必须尝试调用 GRUB Customizer 来自行解决问题。
然后恢复包升级。