Score:0

Package system is broken. --fix-broken does not resolve the issue

cg flag

On Ubuntu 21.04

During a system upgrade, I opened a configuration file in my editor during which my editor crashed, which in turn made apt crash mid upgrade.

Now, when I rerun sudo apt-get upgrade, I get a large number of errors relating to python 3.9 being missing and advised to run apt --fix-broken install:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
 blueman : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
           Depends: gir1.2-ayatanaappindicator3-0.1 but it is not installed
 libboost-mpi-python1.71.0 : Depends: libboost-python1.71.0-py39
                             Depends: libopenmpi3 (>= 4.0.5) but 4.0.3-0ubuntu1 is installed
                             Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 libpython3-dev : Depends: libpython3.9-dev (>= 3.9.4-0~) but it is not installed
 python-typing : Depends: python2:any (< 2.8)
                 Depends: python2:any (>= 2.7~)
 python3-apt : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-dev : Depends: libpython3-dev (= 3.8.2-0ubuntu2) but 3.9.4-1 is installed
 python3-geoip : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-gi : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-gi-cairo : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-icu : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-kiwisolver : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-libtorrent : Depends: libtorrent-rasterbar10 (= 1.2.9-0.2fakesync1build1) but it is not installed
                      Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-markupsafe : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-matplotlib : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-netifaces : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-numpy : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-pil : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-pil.imagetk : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-pivy : Depends: libsoqt520 (>= 1.6.0+ds1) but 1.6.0~ea5cd76+ds1-1ubuntu2 is installed
                Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-protobuf : Depends: libprotobuf23 (>= 3.12.4) but it is not installed
                    Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-psutil : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-pygame : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-pyside2.qtcore : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
                          Depends: libpyside2-py3-5.15 (>= 5.15.2) but it is not installed
                          Depends: libqt5core5a (>= 5.15.1) but 5.12.8+dfsg-0ubuntu1 is installed
                          Depends: libshiboken2-py3-5.15 (>= 5.15.2) but it is not installed
 python3-pyside2.qtgui : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
                         Depends: libpyside2-py3-5.15 (>= 5.15.2) but it is not installed
                         Depends: libqt5core5a (>= 5.15.1) but 5.12.8+dfsg-0ubuntu1 is installed
                         Depends: libqt5gui5 (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed
                         Depends: libqt5gui5 (>= 5.15.1) but 5.12.8+dfsg-0ubuntu1 is installed or
                                  libqt5gui5-gles (>= 5.15.1) but it is not installed
                         Depends: libshiboken2-py3-5.15 (>= 5.15.2) but it is not installed
 python3-pyside2.qtopengl : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
                            Depends: libpyside2-py3-5.15 (>= 5.15.2) but it is not installed
                            Depends: libqt5core5a (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed
                            Depends: libqt5gui5 (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed or
                                     libqt5gui5-gles (>= 5.15) but it is not installed
                            Depends: libqt5opengl5 (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed
                            Depends: libqt5widgets5 (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed
                            Depends: libshiboken2-py3-5.15 (>= 5.15.2) but it is not installed
 python3-pyside2.qtsvg : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
                         Depends: libpyside2-py3-5.15 (>= 5.15.2) but it is not installed
                         Depends: libqt5core5a (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed
                         Depends: libqt5gui5 (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed or
                                  libqt5gui5-gles (>= 5.15) but it is not installed
                         Depends: libqt5svg5 (>= 5.15.1) but 5.12.8-0ubuntu1 is installed
                         Depends: libqt5widgets5 (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed
                         Depends: libshiboken2-py3-5.15 (>= 5.15.2) but it is not installed
 python3-pyside2.qtuitools : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
                             Depends: libpyside2-py3-5.15 (>= 5.15.2) but it is not installed
                             Depends: libqt5core5a (>= 5.15.1) but 5.12.8+dfsg-0ubuntu1 is installed
                             Depends: libqt5gui5 (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed or
                                      libqt5gui5-gles (>= 5.15) but it is not installed
                             Depends: libqt5widgets5 (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed
                             Depends: libshiboken2-py3-5.15 (>= 5.15.2) but it is not installed
 python3-pyside2.qtwidgets : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
                             Depends: libpyside2-py3-5.15 (>= 5.15.2) but it is not installed
                             Depends: libqt5core5a (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed
                             Depends: libqt5gui5 (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed or
                                      libqt5gui5-gles (>= 5.15) but it is not installed
                             Depends: libqt5widgets5 (>= 5.15.1) but 5.12.8+dfsg-0ubuntu1 is installed
                             Depends: libshiboken2-py3-5.15 (>= 5.15.2) but it is not installed
 python3-pyside2.qtxml : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
                         Depends: libpyside2-py3-5.15 (>= 5.15.2) but it is not installed
                         Depends: libqt5core5a (>= 5.15) but 5.12.8+dfsg-0ubuntu1 is installed
                         Depends: libqt5xml5 (>= 5.15.1) but 5.12.8+dfsg-0ubuntu1 is installed
                         Depends: libshiboken2-py3-5.15 (>= 5.15.2) but it is not installed
 python3-rencode : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-renderpm : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-reportlab-accel : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-setproctitle : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-simplejson : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-stl : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-systemd : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-talloc : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
                  Depends: libpython3.9 (>= 3.9.1) but it is not installed
 python3-twisted-bin : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-uno : Depends: libreoffice-common (>= 1:7.0.0~alpha~) but 1:6.4.7-0ubuntu0.20.04.1 is installed
               Depends: libreoffice-core (= 1:7.1.2~rc2-0ubuntu2) but 1:6.4.7-0ubuntu0.20.04.1 is installed or
                        libreoffice-core-nogui (= 1:7.1.2~rc2-0ubuntu2) but it is not installed
               Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
               Depends: libpython3.9 (>= 3.9.1) but it is not installed
 python3-yaml : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-zope.hookable : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-zope.interface : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3.9 : Depends: libpython3.9-stdlib (= 3.9.7-1+focal1) but it is not installed
 python3.9-dev : Depends: libpython3.9-dev (= 3.9.7-1+focal1) but it is not installed
                 Depends: libpython3.9 (= 3.9.7-1+focal1) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)

When I run apt --fix-broken install however, an error occurs when install python3.9-minimal:

Setting up python3.9-minimal (3.9.7-1+focal1) ...
Traceback (most recent call last):
  File "/usr/lib/python3.9/py_compile.py", line 9, in <module>
    import importlib.util
  File "/usr/lib/python3.9/importlib/util.py", line 2, in <module>
    from . import abc
  File "/usr/lib/python3.9/importlib/abc.py", line 17, in <module>
    from typing import Protocol, runtime_checkable
ModuleNotFoundError: No module named 'typing'
dpkg: error processing package python3.9-minimal (--configure):
 installed python3.9-minimal package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 python3.9-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried manually installing the ubuntu python typing package (python-typing_3.6.6-2_all) and python 3.9 (python3.9_3.9.4-1_amd64.deb) using pdkg -i, but in the former case get an error relating to unmet dependencies:

(Reading database ... 489468 files and directories currently installed.)
Preparing to unpack python-typing_3.6.6-2_all.deb ...
Unpacking python-typing (3.6.6-2) over (3.6.6-2) ...
dpkg: dependency problems prevent configuration of python-typing:
 python-typing depends on python2:any (<< 2.8).
 python-typing depends on python2:any (>= 2.7~).

dpkg: error processing package python-typing (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python-typing

and in the latter:

(Reading database ... 489468 files and directories currently installed.)
Preparing to unpack python3.9_3.9.4-1_amd64.deb ...
Unpacking python3.9 (3.9.4-1) over (3.9.7-1+focal1) ...
dpkg: dependency problems prevent configuration of python3.9:
 python3.9 depends on python3.9-minimal (= 3.9.4-1); however:
  Version of python3.9-minimal on system is 3.9.7-1+focal1.
 python3.9 depends on libpython3.9-stdlib (= 3.9.4-1); however:
  Package libpython3.9-stdlib is not installed.

dpkg: error processing package python3.9 (--install):
 dependency problems - leaving unconfigured
Processing triggers for desktop-file-utils (0.26-1ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 python3.9

I've also tried installing these packages with pip to no avail.

user535733 avatar
cn flag
Did the crash occur during a daily upgrade? Or during the big release-upgrade from 20.10? Or during an "upgrade" from some other release of Ubuntu?
cg flag
The crash occured after I manually ran `apt-get upgrade`
user535733 avatar
cn flag
Try `sudo apt-get full-upgrade`. Read the complete output of changes before agreeing.
in flag
It looks like you installed version 3 of python-typing for python version 2 ([python-typing_3.6.6-2_all.deb](https://ubuntu.pkgs.org/20.04/ubuntu-universe-amd64/python-typing_3.6.6-2_all.deb.html)), which is confusing! Maybe the correct package for the typing modules is python3-typing*? You might be able to install Python3 "Typing" module with pip, but this suggests it should be part of the main python package, perhaps you can [download an earlier Python3](https://packages.ubuntu.com/hirsute/python3) and try that?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.