Volian Scar repo 想要更新 python3-anyio,但这会带来依赖性问题

Volian Scar repo 想要更新 python3-anyio,但这会带来依赖性问题

我使用的是 Ubuntu 22.04.3 Server。我nala使用Volian Scar 回购. 最近,该 repo 包含了许多更新的 Python 3 软件包,其中包括python3-anyio

但是,这个特定的包不会升级:

$ sudo apt full-upgrade
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  python3-mdurl
The following packages have been kept back:
  python3-anyio
The following packages will be upgraded:
  python3-click python3-httpcore python3-markdown-it python3-pygments python3-rich python3-typer python3-typing-extensions
7 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
...

如果我尝试强制安装python3-anyio,我会得到确切的原因:

$ sudo apt install --reinstall --dry-run python3-anyio 
Reading package lists... Done
Building dependency tree... Done
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:
 python3-anyio : Depends: python3-exceptiongroup but it is not installable or
                          python3 (> 3.11) but 3.10.6-1~22.04 is to be installed
E: Unable to correct problems, you have held broken packages.

现在很明显,这个更新的包需要 Python 3 “异常组”,它要么包含在 Python 3.11 中(Ubuntu 22.04 使用 Python 3.10),要么包含在反向移植的包中python3-exceptiongroup

在以下位置搜索此包Ubuntu 软件包存档显示该软件包是 Universe 存储库的一部分,但仅适用于 Ubuntu 23.04(Lunar)或 23.10(Mantic)。

当我仍然想升级我的软件包时,我有什么选择可以避免这种情况下出现的依赖问题?

仅供参考,这已被报告为Volian 的问题python3-exceptiongroup。我认为将来应该会将这个包添加到 Volian 仓库中。

ALASpython3-exceptiongroup已经添加到 Volian Scar 仓库,所以现在这个依赖错误不再出现。不过,本问答中的方法可以用于其他类似情况。

答案1

一般来说,你有两个选择:

  1. 保留该软件包python3-anyio(因此该特定软件包不会升级),或者
  2. 手动安装python3-exceptiongroup

1. 拿着包裹python3-anyio

运行此命令来阻止该包python3-anyio

sudo apt-mark hold python3-anyio

查看保留的包裹:

apt-mark showhold

现在,当您运行升级命令时,python3-anyio将始终停留在当前版本。

如果您稍后想要升级该软件包,请使用以下命令取消升级:

sudo apt-mark unhold python3-anyio

2.python3-exceptiongroup手动安装

此方法要求您手动下载软件包的副本python3-exceptiongroup并安装它。在这种情况下,我会选择直接从 Debian Sid 存储库下载最新版本。(由于这是 Python 3 的附加包,我认为这里出现另一个依赖问题的风险可以忽略不计。)

wget http://ftp.de.debian.org/debian/pool/main/p/python-exceptiongroup/python3-exceptiongroup_1.1.3-1_all.deb

然后安装它:

sudo apt install ./python3-exceptiongroup_1.1.3-1_all.deb

现在python3-anyio已经满足了它的依赖性,通过运行以下命令可以明显看出:

$ sudo apt install --reinstall --dry-run python3-anyio 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be upgraded:
  python3-anyio
1 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
...

现在您终于可以运行完整的升级命令,而不会有任何软件包被阻止:

$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  python3-mdurl
The following packages will be upgraded:
  python3-anyio python3-click python3-httpcore python3-markdown-it python3-pygments python3-rich python3-typer python3-typing-extensions
8 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
...

相关内容