![升级到 22.04 后无法删除旧的 linux 镜像](https://linux22.com/image/946289/%E5%8D%87%E7%BA%A7%E5%88%B0%2022.04%20%E5%90%8E%E6%97%A0%E6%B3%95%E5%88%A0%E9%99%A4%E6%97%A7%E7%9A%84%20linux%20%E9%95%9C%E5%83%8F.png)
我最近从 升级Ubuntu 21.10
到22.04
,整个过程非常顺利,没有报告任何错误。
每当我尝试运行系统更新时,dpkg
都会引发与旧版本相关的以下错误linux-image
:
/etc/grub.d/bin/grubcfg_proxy: error while loading shared libraries: libcrypto.so.1.1: 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-5.13.0-39-generic (--remove):
installed linux-image-5.13.0-39-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.13.0-39-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
dpkg
remove
显示和的状态Half
:
rH linux-image-5.13.0-39-generic 5.13.0-39.44 amd64 Signed kernel image generic
日志中的内容如下dpkg
:
2022-04-25 11:15:54 startup packages remove
2022-04-25 11:15:54 status half-installed linux-image-5.13.0-39-generic:amd64 5.13.0-39.44
2022-04-25 11:15:54 remove linux-image-5.13.0-39-generic:amd64 5.13.0-39.44 <none>
2022-04-25 11:15:55 startup archives unpack
我尝试重新安装该软件包,但在尝试先删除旧软件包libssl1.0
时,出现了与上述相同的错误。我还尝试清除映像,但也出现了与上述相同的错误。dpkg
linux-image
sudo apt purge linux-image-5.13.0-39-generic
我无法重新安装旧图像,因为它无法安装。
sudo apt install --reinstall linux-image-5.13.0-39-generic
The following packages have unmet dependencies:
linux-image-5.13.0-39-generic : Depends: linux-modules-5.13.0-39-generic but it is not installable
答案1
我们需要手动修复缺失的libssl1.1
库。请前往 Debian 官方在线软件包库并下载与您的系统匹配的二进制包:https://packages.debian.org/stretch/libssl1.1
然后您需要运行以下命令来安装libssl1.1
:
sudo dpkg --install libssl1.1*.deb
此后,缺失的依赖项应该被修复,然后你可以清理linux-image
sudo apt purge <linux-image-name-to-remove>