更新到 Ubuntu 18.04 后,当我尝试通过以下方式升级系统时
sudo apt update && sudo apt upgrade
我明白了:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
gdb gir1.2-peas-1.0 libpeas-1.0-0 openshot
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
当然我尝试过sudo apt install -f
但没有成功:
$ sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
一个建议的解决方案是分别安装,但这也不起作用:
$ sudo apt install libpeas-1.0-0
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:
libpeas-1.0-0 : Depends: libpython3.6 (>= 3.6.4~rc1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
所以我尝试安装 libpython3.6,但没有成功,因为
The following packages have unmet dependencies:
libpython3.6 : Depends: libpython3.6-stdlib (= 3.6.5-3) but 3.6.5-5~16.04.york1 is to be installed
现在我无法删除/安装/降级到此版本,因为 apt 会删除大约 200 个软件包,包括 xorg、firefox、gnome-session 以及几乎所有我听说过的软件包。
我想尝试的另一件事来自这个问题这里曾是
sudo dpkg --install --force all /var/cache/apt/archives/libpython3[version].deb
但没有我需要的版本号的文件。
编辑:我通过下载了特定版本,apt download libpython3.6-stdlib=3.6.5-3
并使用上述命令进行了安装。现在我既无法升级也无法自动删除,并且两者都收到此警告:
The following packages have unmet dependencies:
libpython3.6-stdlib : Depends: libpython3.6-minimal (= 3.6.5-3) but 3.6.5-5~16.04.york1 is installed
python3.6 : Depends: libpython3.6-stdlib (= 3.6.5-5~16.04.york1) but 3.6.5-3 is installed
我还能做什么?感谢您的帮助。
答案1
看起来我是通过以下方式安装 python3.6 的死蛇Ubuntu 16 中的 ppa。然后,在让 Ubuntu 本身升级到 18 之后,它处于一种冲突状态,依赖于该libpython
库,大概来自 deadsnakes ppa,但是有一个较新版本的 python 不再知道该依赖项。
首先,我必须通过以下方式艰难地删除 ppa:
sudo rm -f /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa*
然后删除冲突的库
sudo apt remove libpython3.6-*
删除libpython3.6-minimal
和libpython3.6-stdlib
,但这并没有完全破坏我的系统。
做一个
sudo apt update && sudo apt upgrade
安装了 python3.6,但存在一些主要警告。
我不得不[重新安装ubuntu-desktop
](下次登录时)。所以你最好运行
sudo apt install ubuntu-desktop
在关闭计算机之前!!!!!!!!!!!!!
答案2
我遇到了类似的问题,这个 cmd 帮助了我:
sudo apt-get install gdb/bionic gir1.2-peas-1.0/bionic libpeas-1.0-0/bionic python3.6/bionic python3.6-minimal/bionic libpython3.6/bionic libpython3.6-minimal/bionic libpython3.6-stdlib/bionic
答案3
该问题是由jonathonf/python-3.6
我在 16.04 中启用的 PPA 引起的。升级到 18.04 后,禁用了此 PPA,安装了非 ppa 版本的 libpython3.6(york 版本来自 PPA),因此导致缺少依赖项。首先,我必须使用类似的 apt 下载和强制 dpkg 命令来恢复编辑中提到的降级。
我重新启用了 PPA(也将 bionic 更改为 xenial /etc/apt/sources.list.d/jonathonf-ubuntu-python-3_6-xenial.list
),经过简单的
sudo apt update && sudo apt install -f && sudo apt upgrade
现在一切又正常了。
答案4
我有同样的问题:
日志(抱歉,是葡萄牙语):
数据包接下来的依赖项如下:
libpython3.6 : Depende: libpython3.6-stdlib (= 3.6.15-1+focal3) mas 3.6.15-1+focal2 está para ser instalado
libpython3.6-dev : Depende: libpython3.6-stdlib (= 3.6.15-1+focal3) mas 3.6.15-1+focal2 está para ser instalado
libpython3.6-stdlib : Depende: libpython3.6-minimal (= 3.6.15-1+focal2) mas 3.6.15-1+focal3 está para ser instalado
libpython3.7 : Depende: libpython3.7-stdlib (= 3.7.13-1+focal3) mas 3.7.13-1+focal1 está para ser instalado
libpython3.7-dev : Depende: libpython3.7-stdlib (= 3.7.13-1+focal3) mas 3.7.13-1+focal1 está para ser instalado
libpython3.7-stdlib : Depende: libpython3.7-minimal (= 3.7.13-1+focal1) mas 3.7.13-1+focal3 está para ser instalado
python3.6 : Depende: libpython3.6-stdlib (= 3.6.15-1+focal3) mas 3.6.15-1+focal2 está para ser instalado
python3.7 : Depende: libpython3.7-stdlib (= 3.7.13-1+focal3) mas 3.7.13-1+focal1 está para ser instalado
E: Dependências desencontradas. Tente 'apt --fix-broken install' sem nenhum pacote (ou especifique uma solução).
日志说你应该使用“apt --fix-broken install”,所以我通过升级完成了它。
这为我解决了这个问题:
sudo apt --fix-broken upgrade