6

升级到 ubuntu 20.04 后,一些包仍保留在 +bionic1 版本中

sudo apt list | grep python3.8


WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

idle-python3.8/focal-updates,focal-updates,focal-security,focal-security 3.8.2-1ubuntu1.1 all
libpython3.8-dbg/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
libpython3.8-dbg/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
libpython3.8-dev/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
libpython3.8-dev/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
libpython3.8-minimal/now 3.8.2-1+bionic1 amd64 [installed,local]
libpython3.8-minimal/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
libpython3.8-stdlib/now 3.8.2-1+bionic1 amd64 [installed,local]
libpython3.8-stdlib/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
libpython3.8-testsuite/focal-updates,focal-updates,focal-security,focal-security 3.8.2-1ubuntu1.1 all
libpython3.8/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
libpython3.8/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
python3.8-dbg/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
python3.8-dbg/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
python3.8-dev/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
python3.8-dev/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
python3.8-doc/focal-updates,focal-updates,focal-security,focal-security 3.8.2-1ubuntu1.1 all
python3.8-examples/focal-updates,focal-updates,focal-security,focal-security 3.8.2-1ubuntu1.1 all
python3.8-minimal/now 3.8.2-1+bionic1 amd64 [installed,local]
python3.8-minimal/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
python3.8-venv/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
python3.8-venv/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
python3.8/now 3.8.2-1+bionic1 amd64 [installed,local]
python3.8/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386

正如您在上面看到的,python3.8-minimal/now 3.8.2-1+bionic1 amd64 [installed,local]如果我想清除并安装 python3.8,那么许多依赖项也将被删除,这可能会导致我的操作系统崩溃我如何推动 ubuntu 将所有安装 +bionic1 包切换到焦点版本ubuntu1.1ubuntu1

4

3 回答 3

9

最终,维护人员可能需要为 Python 包制作上游补丁,因为版本/纪元解析器显然认为前缀-1+bionic1-1ubuntu1.1.

在我的例子中,Python 3.8 的前缀来自于从deadsnakes PPA-1+bionic1安装 Python 3.8 包,而不是来自规范存储库。

也就是说,我能够使用以下命令强制“降级”到正确的 Ubuntu-Focal 软件包:

sudo apt install libpython3.8:amd64=3.8.2-1ubuntu1.1 libpython3.8-dev:amd64=3.8.2-1ubuntu1.1 libpython3.8-minimal:amd64=3.8.2-1ubuntu1.1 libpython3.8-stdlib:amd64=3.8.2-1ubuntu1.1 python3.8=3.8.2-1ubuntu1.1 python3.8-minimal=3.8.2-1ubuntu1.1

我在尝试安装其他 Python 库时遇到了这个问题,比如python3-venv在 18.04->20.04 系统升级之后,这些包将它们的依赖项固定在3.8.2-1ubuntu1.1版本上。

于 2020-05-09T21:22:29.307 回答
6

从 18.04 升级到 20.04 后,我在安装 vim 时遇到了类似的问题。结合 pztrick 答案和 oon arfiandwi 对已接受答案的评论对我有用

sudo apt install libpython3.8:amd64=3.8.2-1ubuntu1 libpython3.8-dev:amd64=3.8.2-1ubuntu1 libpython3.8-minimal:amd64=3.8.2-1ubuntu1 libpython3.8-stdlib:amd64=3.8.2-1ubuntu1 python3.8=3.8.2-1ubuntu1 python3.8-minimal=3.8.2-1ubuntu1
于 2021-04-26T02:45:53.007 回答
0

运行后 apt --fix-broken install 我可以安装vim。

于 2021-05-20T16:00:11.507 回答