升级到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.1
或ubuntu1
答案 0 :(得分:3)
最终,维护者可能需要对Python软件包进行上游修补,因为版本/时代分析器显然认为前缀-1+bionic1
比-1ubuntu1.1
更新。
在我的情况下,Python 3.8的-1+bionic1
前缀来自从deadsnakes PPA而非标准存储库安装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
在18.04-> 20.04系统升级后,我尝试安装其他Python库(例如python3-venv
)时遇到了这个问题,这些软件包将其依赖项固定为3.8.2-1ubuntu1.1
版本。
答案 1 :(得分:2)
我在从 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
答案 2 :(得分:0)
运行后
apt --fix-broken install
我可以安装vim。