将 ubuntu 18.04 升级到 20.04 但软件包仍然是 +bionic1

upgrade ubuntu 18.04 to 20.04 but packages remain +bionic1

升级到 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 则保留仿生版本,那么许多依赖项也会被删除,这可能会导致我的 OS 崩溃我怎样才能按 ubuntu 将所有安装 +bionic1 包切换到焦点版本 ubuntu1.1ubuntu1

最终,维护者可能需要对 Python 包进行上游修补,因为 version/epoch 解析器显然认为前缀 -1+bionic1-1ubuntu1.1 更新.

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

就是说,我能够使用此命令将 "downgrade" 强制到正确的 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

我 运行 在 18.04->20.04 系统升级后尝试安装其他 Python 库,如 python3-venv,这些包将它们的依赖项固定到 3.8.2-1ubuntu1.1版本。

我在从 18.04 升级到 20.04 后安装 vim 时遇到了类似的问题。结合 pztrick answer 和 oon arfiandwi comment on accepted answer 对我有用

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

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