为什么 APT 无法识别软件包的较新版本?

为什么 APT 无法识别软件包的较新版本?

这是我最近遇到的一个非常奇怪的问题,这种情况似乎经常发生,我很担心事情会变得比现在更糟。这个问题发生了很多次,但这里只是一个例子:

sudo apt-get install openvpn-systemd-resolved 

输出如下:

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:
 openvpn-systemd-resolved : Depends: libnss-resolve but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

当我尝试sudo apt-get install libnss-resolve

这是我得到的:

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:
 libnss-resolve : Depends: systemd (= 237-3ubuntu10.3)
E: Unable to correct problems, you have held broken packages.

但是systemd明显安装的是高版本啊!

apt show systemd

告诉我:

Package: systemd
Version: 237-3ubuntu10.9
Status: install ok installed

我需要尽快解决这个问题。我无法安装很多软件包,因为似乎总是会出现“您持有损坏的软件包。”的消息弹出。

是的,在您说之前,我已经尝试了所有这些(没有任何错误输出):

sudo apt --fix-broken install
sudo dpkg --configure --pending
sudo dpkg --configure -a
sudo apt-get -f install
sudo apt update --fix-missing

这种情况以前在 libgtk-3-0 上发生过一次,删除/重新安装该软件包最终确实有效,但您可以想象删除它后修复所有问题需要经历的痛苦(libgtk-3-0 是许多其他软件包的依赖项)。有解决办法吗?降级我的软件包,尤其是像 systemd 这样的核心软件包是我最不想做的事情。

相关内容