尽管依赖项已安装,“apt-get purge” 因“未满足的依赖项”错误而失败

尽管依赖项已安装,“apt-get purge” 因“未满足的依赖项”错误而失败

我使用的是 Debian Stretch。当我尝试运行 apt-get purge 时,它​​失败并出现未满足依赖项的错误:

$ sudo apt-get purge -f openssl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 vim-gtk : Depends: libruby2.3 (>= 2.3.0~preview2) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

最后一行似乎表明无法安装 libruby2.3,但它和 vim-gtk 都已安装:

$ sudo apt-cache policy vim-gtk
vim-gtk:
  Installed: 2:8.0.0197-4+deb9u3
  Candidate: 2:8.0.0197-4+deb9u3
  Version table:
 *** 2:8.0.0197-4+deb9u3 500
        500 http://debian.mirror.iweb.ca/debian stretch/main amd64 Packages
        500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
        500 http://deb.debian.org/debian oldstable/main amd64 Packages
        100 /var/lib/dpkg/status

$ sudo apt-cache policy libruby2.3
libruby2.3:
  Installed: 2.3.3-1+deb9u9
  Candidate: 2.3.3-1+deb9u9
  Version table:
 *** 2.3.3-1+deb9u9 500
        500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.3.3-1+deb9u8 500
        500 http://debian.mirror.iweb.ca/debian stretch/main amd64 Packages
        500 http://deb.debian.org/debian oldstable/main amd64 Packages

我尝试清除并重新安装 vim-gtk 和 libruby2.3,这似乎有效:

$ sudo apt-get purge vim-gtk libruby2.3
$ sudo apt-get install vim-gtk libruby2.3

但是,在此之后,我在运行 时仍然会收到相同的错误sudo apt-get purge -f openssl。是什么导致了此错误?为什么 apt 告诉我它不会安装,而它已经安装了?

我尝试了其他类似问题的一些建议(sudo apt-get install -f,,sudo apt-get update/clean/autoremove但错误仍然存​​在)

答案1

这是开始可能最终的答案是:

我无法判断删除 openssl 是否是明智之举;我倾向于“不明智”。

以下是我当前的 Ubuntu 20.04 LTS 中的内容:

$ dpkg --list | head -n 4 && dpkg --list | grep openssl
期望=未知/安装/移除/清除/保留
| 状态=未/安装/Conf-文件/未打包/halF-conf/半安装/trig-aWait/Trig-pend
|/ 错误?=(无)/需要重新安装(状态,错误:大写=坏)
||/ 名称 版本 架构 描述
ii libevent-openssl-2.1-7:amd64 2.1.11-stable-1 amd64 异步事件通知库(openssl)
ii openssl 1.1.1f-1ubuntu2.1 amd64 安全套接字层工具包 - 加密实用程序
ii perl-openssl-defaults:amd64 4 Perl OpenSSL 软件包的 amd64 版本兼容性基准

相关内容