升级到 22.04 后无法删除旧的 linux 镜像

升级到 22.04 后无法删除旧的 linux 镜像

我最近从 升级Ubuntu 21.1022.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)

dpkgremove显示和的状态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时,出现了与上述相同的错误。我还尝试清除映像,但也出现了与上述相同的错误。dpkglinux-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>

相关内容