当稳定的包有不稳定的依赖时怎么办?

当稳定的包有不稳定的依赖时怎么办?

apt我有一些故意拖延的包裹。这是我所看到的示例:

> apt update
...
<error-free list of all my repos being fetched>
...
Fetched 88.7 kB in 4s (22.7 kB/s)                   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
9 packages can be upgraded. Run 'apt list --upgradable' to see them.

> apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  fontconfig fontconfig-config ghostscript-x libfontconfig1-dev libgs9-common
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

我解决这个问题的常用方法是开始明确列出被阻止的包,这样我就可以得到更好的输出,告诉我为什么包被阻止。使用这种方法,我相信有 2 个不同的被扣留包裹组:libfontconfig1组和libfreetype6组。

例如,当我尝试升级fontconfigfontconfig-config

> apt upgrade fontconfig fontconfig-config
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... 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:
 fontconfig : Depends: libfontconfig1 (>= 2.13.0) but 2.12.6-0ubuntu2 is to be installed
 fontconfig-config : Breaks: libfontconfig1 (< 2.13.0) but 2.12.6-0ubuntu2 is to be installed
E: Broken packages

libfontconfig1当它同时想要大于或等于 2.13.0 但又必须小于 2.13.0 时我该怎么办?

捆绑libfreetype6包略有不同:

> apt upgrade ghostscript-x libfontconfig1-dev libgs9-common ghostscript libgs9 libfontconfig1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... 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:
 libfontconfig1 : Depends: libfreetype6 (>= 2.9.1) but 2.8.1-2ubuntu2 is to be installed
 libgs9 : Depends: libfreetype6 (>= 2.10.1) but 2.8.1-2ubuntu2 is to be installed
E: Broken packages

在这里,我得到了一段解释这种情况的段落,但我没有如何应对的行动方案。看来 libfreetype6 2.10 仍然在不稳定的存储库中。我真的很想避免在我的机器上添加不稳定的存储库。感觉这个问题一旦 2.10 稳定就会消失。

这些也感觉像是我无法轻易避免的问题。我的理解是,为了发生这种情况,我添加了负责存储库的人,在升级该包的所有依赖项之前将其升级为稳定版本。除了对我添加的存储库进行更多限制之外,我不确定如何避免这种情况。

现在我已经陷入了这样的困境,我该如何摆脱困境呢?其中一些包是其他重要包的依赖项,例如用于打印的 Ghostscript。看来卸载并重新安装是不可能的。

请告诉我,等待软件包从不稳定的存储库中升级并不是我唯一能做的事情。

Linux 薄荷 19.3 x64

编辑:根据评论的要求,我运行了一些额外的命令。运行apt install每个有问题的包给了我类似的输出:

> apt install fontconfig fontconfig-config
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:
 fontconfig : Depends: libfontconfig1 (>= 2.13.0) but 2.12.6-0ubuntu2 is to be installed
 fontconfig-config : Breaks: libfontconfig1 (< 2.13.0) but 2.12.6-0ubuntu2 is to be installed
 libfreerdp-client2-2 : Depends: libavcodec57 (>= 7:3.4.6) but it is not going to be installed or
                                 libavcodec-extra57 (>= 7:3.4.6) but it is not going to be installed
 libfreerdp2-2 : Depends: libavcodec57 (>= 7:3.4.6) but it is not going to be installed or
                          libavcodec-extra57 (>= 7:3.4.6) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

我不太了解,apt policy但我还是跑了:

> apt policy libfontconfig1 libfreetype6
libfontconfig1:
  Installed: 2.12.6-0ubuntu2
  Candidate: 2.13.1-2ubuntu2~18.04.sav2
  Version table:
     2.13.1-2ubuntu2~18.04.sav2 500
        500 http://ppa.launchpad.net/savoury1/multimedia/ubuntu bionic/main amd64 Packages
 *** 2.12.6-0ubuntu2 500
        500 http://la-mirrors.evowise.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
libfreetype6:
  Installed: 2.8.1-2ubuntu2
  Candidate: 2.8.1-2ubuntu2
  Version table:
 *** 2.8.1-2ubuntu2 500
        500 http://la-mirrors.evowise.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

相关内容