Ubuntu 18.04 Can't upgrade because of libpython3.6 version conflicts

Doo*_*opy 6 upgrade package-management apt

After having updated to Ubuntu 18.04, when I try to upgrade my system via

sudo apt update && sudo apt upgrade
Run Code Online (Sandbox Code Playgroud)

I get this:

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.
Run Code Online (Sandbox Code Playgroud)

Of course I tried sudo apt install -f without success:

$ 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.
Run Code Online (Sandbox Code Playgroud)

One suggested solution was to install each separately, but that doesn't work either:

$ 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.
Run Code Online (Sandbox Code Playgroud)

So I tried to install libpython3.6, which doesn't work because

 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
Run Code Online (Sandbox Code Playgroud)

Now I can't remove/install/downgrade to this version because apt would then remove about 200 packages including things like xorg, firefox, gnome-session and pretty much every package I ever heard of.

One other thing I wanted to try taken from the question here was

sudo dpkg --install --force all /var/cache/apt/archives/libpython3[version].deb
Run Code Online (Sandbox Code Playgroud)

but there was no file with my needed version number.

Edit: I downloaded the specific version via apt download libpython3.6-stdlib=3.6.5-3 and installed it with above command. Now I can neither do upgrade nor autoremove, and I get this warning for both:

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
Run Code Online (Sandbox Code Playgroud)

What else can I do? Thanks for any help.

The*_*ist 9

看起来我是通过Ubuntu 16 中的deadsnakes ppa安装了 python3.6 到这里的。然后,在让 Ubuntu 本身升级到 18 之后,它处于一种冲突状态,依赖于libpython可能来自 deadsnakes ppa 的库,但还有一个更新的不再知道该依赖项的 python 版本。

首先,我不得不通过以下方式艰难地移除 ppa

sudo rm -f /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa*
Run Code Online (Sandbox Code Playgroud)

然后删除冲突的库

sudo apt remove libpython3.6-*
Run Code Online (Sandbox Code Playgroud)

删除libpython3.6-minimaland libpython3.6-stdlib,这在某种程度上并没有完全破坏我的系统。

做一个

sudo apt update && sudo apt upgrade
Run Code Online (Sandbox Code Playgroud)

安装了 python3.6,但有一些主要的警告。

我不得不[重新安装ubuntu-desktop](下次登录时)。所以可能更适合你跑步

sudo apt install ubuntu-desktop
Run Code Online (Sandbox Code Playgroud)

在关闭计算机之前!!!!!!!!!!!!!!!


1rq*_*wre 7

我遇到了类似的问题,这个命令帮助了我: 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


Doo*_*opy 3

jonathonf/python-3.6该问题是由我在 16.04 中启用的 PPA引起的。升级到18.04。禁用了这个PPA,在非ppa版本中安装了libpython3.6(york版本来自PPA),因此导致依赖项缺失。首先,我必须使用类似的 apt download 和强制 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
Run Code Online (Sandbox Code Playgroud)

现在一切又恢复正常了。