Score:0

dpkg dependency problems: Package python3 is not configured yet

ps flag

I had to perform a reboot recently, and running sudo apt upgrade has resulted in dependency problems ever since:

The following packages were automatically installed and are no longer required:
  libapparmor1 libargon2-1 libcryptsetup12 libdevmapper1.02.1 libip4tc2 libjson-c5 libkmod2 systemd
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
13 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python3 (3.10.6-1~22.04) ...
running python rtupdate hooks for python3.10...
dpkg-query: package 'ibus-table' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of ibus-table
error running python rtupdate hook ibus-table
dpkg-query: package 'ibus' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of ibus
error running python rtupdate hook ibus
dpkg-query: package 'python3-uno' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of python3-uno
error running python rtupdate hook python3-uno
dpkg-query: package 'system-config-printer-common' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of system-config-printer-common
error running python rtupdate hook system-config-printer-common
dpkg-query: package 'system-config-printer' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of system-config-printer
error running python rtupdate hook system-config-printer
dpkg: error processing package python3 (--configure):
 installed python3 package post-installation script subprocess returned error exit status 4
Setting up systemd (249.11-0ubuntu3.9) ...
cp: '/etc/resolv.conf' and '/run/systemd/resolve/stub-resolv.conf' are the same file
dpkg: error processing package systemd (--configure):
 installed systemd package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of python3-wheel:
 python3-wheel depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-wheel (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-dev:
 python3-dev depends on python3 (= 3.10.6-1~22.04); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-pip:
 python3-pip depends on python3-wheel; however:
  Package python3-wheel is not configured yet.
 python3-pip depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-pip (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lsb-release:
 lsb-release depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package lsb-release (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-lib2to3:
 python3-lib2to3 depends on python3:any (>= 3.10.5-0~); however:
  Package python3 is not configured yet.
 python3-lib2to3 depends on python3:any (<< 3.12); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-lib2to3 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-pkg-resources:
 python3-pkg-resources depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-pkg-resources (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-distutils:
 python3-distutils depends on python3:any (>= 3.10.5-0~); however:
  Package python3 is not configured yet.
 python3-distutils depends on python3:any (<< 3.12); however:
  Package python3 is not configured yet.
 python3-distutils depends on python3-lib2to3 (= 3.10.6-1~22.04); however:
  Package python3-lib2to3 is not configured yet.

dpkg: error processing package python3-distutils (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-setuptools:
 python3-setuptools depends on python3-pkg-resources (= 59.6.0-1.2ubuntu0.22.04.1); however:
  Package python3-pkg-resources is not configured yet.
 python3-setuptools depends on python3-distutils; however:
  Package python3-distutils is not configured yet.
 python3-setuptools depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-setuptools (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-distro:
 python3-distro depends on lsb-release; however:
  Package lsb-release is not configured yet.
 python3-distro depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-distro (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of hplip-data:
 hplip-data depends on python3-distro; however:
  Package python3-distro is not configured yet.
 hplip-data depends on python3:any; however:
  Package python3 is not configured yet.

  Package lsb-release is not configured yet.
 python3-distro depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-distro (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of hplip-data:
 hplip-data depends on python3-distro; however:
  Package python3-distro is not configured yet.
 hplip-data depends on python3:any; however:
  Package python3 is not configured yet.

  Package lsb-release is not configured yet.
 python3-distro depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-distro (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of hplip-data:
 hplip-data depends on python3-distro; however:
  Package python3-distro is not configured yet.
 hplip-data depends on python3:any; however:
  Package lsb-release is not configured yet.
 python3-distro depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-distro (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of hplip-data:
 hplip-data depends on python3-distro; however:
  Package python3-distro is not configured yet.
 hplip-data depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package hplip-data (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-all:
 python3-all depends on python3 (= 3.10.6-1~22.04); however:
  Package python3 is not configured yet.
 python3-all depends on python3-distutils (>= 3.10.6-1~); however:
  Package python3-distutils is not configured yet.

dpkg: error processing package python3-all (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python3
 systemd
  Package lsb-release is not configured yet.
 python3-distro depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-distro (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of hplip-data:
 hplip-data depends on python3-distro; however:
  Package python3-distro is not configured yet.
 hplip-data depends on python3:any; however:
  Package python3 is not configured yet.

  Package lsb-release is not configured yet.
 python3-distro depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-distro (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of hplip-data:
 hplip-data depends on python3-distro; however:
  Package python3-distro is not configured yet.
 hplip-data depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package hplip-data (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-all:
 python3-all depends on python3 (= 3.10.6-1~22.04); however:
  Package python3 is not configured yet.
 python3-all depends on python3-distutils (>= 3.10.6-1~); however:
  Package python3-distutils is not configured yet.

dpkg: error processing package python3-all (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python3
 systemd
 python3-wheel
 python3-dev
 python3-pip
 lsb-release
 python3-lib2to3
 python3-pkg-resources
 python3-distutils
 python3-setuptools
 python3-distro
 hplip-data
 python3-all
E: Sub-process /usr/bin/dpkg returned an error code (1)

The output is the same for sudo apt --fix-broken install. Some time ago, I updated the python symlinks in /usr/bin to point to python3.11 instead of python3.10. It seemed to work without issues, but maybe that can cause problems like this? I have since attempted to reinstall both versions which replaced the symlinks.

Here are the problematic packages from dpkg -l:

iF  python3                     3.10.6-1~22.04                          amd64        interactive high-level object-oriented language (default python3 ver>
iU  python3-all                 3.10.6-1~22.04                          amd64        package depending on all supported Python 3 runtime versions
iU  python3-dev                 3.10.6-1~22.04                          amd64        header files and a static library for Python (default)
iU  python3-distro              1.7.0-1                                 all          Linux OS platform information API
iU  python3-distutils           3.10.6-1~22.04                          all          distutils package for Python 3.x
iU  python3-lib2to3             3.10.6-1~22.04                          all          Interactive high-level object-oriented language (lib2to3)
ii  python3-minimal             3.10.6-1~22.04                          amd64        minimal subset of the Python language (default python3 version)
iU  python3-pip                 22.0.2+dfsg-1ubuntu0.3                  all          Python package installer
iU  python3-pkg-resources       59.6.0-1.2ubuntu0.22.04.1               all          Package Discovery and Resource Access using pkg_resources
iU  python3-setuptools          59.6.0-1.2ubuntu0.22.04.1               all          Python3 Distutils Enhancements
iU  python3-wheel               0.37.1-2ubuntu0.22.04.1                 all          built-package format for Python

Additionally, systemd also shows up as "iF" for some reason. When I tried sudo dpkg --configure python3:

Setting up python3 (3.10.6-1~22.04) ...
running python rtupdate hooks for python3.10...
dpkg-query: package 'ibus-table' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of ibus-table
error running python rtupdate hook ibus-table
dpkg-query: package 'ibus' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of ibus
error running python rtupdate hook ibus
dpkg-query: package 'python3-uno' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of python3-uno
error running python rtupdate hook python3-uno
dpkg-query: package 'system-config-printer-common' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of system-config-printer-common
error running python rtupdate hook system-config-printer-common
dpkg-query: package 'system-config-printer' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/py3clean", line 210, in <module>
    main()
  File "/usr/bin/py3clean", line 196, in main
    pfiles = set(dpf.from_package(options.package))
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of system-config-printer
error running python rtupdate hook system-config-printer
dpkg: error processing package python3 (--configure):
 installed python3 package post-installation script subprocess returned error exit status 4
Errors were encountered while processing:
 python3

The output is similar for sudo dpkg --configure -a. I noticed "ibus-table" wasn't installed, so I tried that, resulting in a similar errors to the first output. I believe doing this also caused systemd to show as "iF" in the dpkg list.

I also tried forcefully removing with sudo dpkg --remove --force-depends python3 and reinstalling. Everything has resulted similar errors. I'm running versin 22.04.2.

EDIT: I think I was able to fix some of the packages by deleting /etc/resolv.conf and then running sudo apt --fix-broken install. The only package with dependency errors now is python3.

Score:0
ps flag

I believe I have solved this by installing these packages:

sudo apt install python3-uno system-config-printer-common system-config-printer

and then running:

sudo apt --fix-broken install

I'm not sure if or why these ones specifically caused the issue, but it ended up resolving the issue at least for now.

I sit in a Tesla and translated this thread with Ai:

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.