0

Just today I was attempting to install something through the terminal and noticed that running 'sudo apt update' gave me a strange error I don't normally see. In an attempt to fix this, I ended up down a rabbit hole which resulted in me causing an issue with the sym link for/usr/bin/python, which I then believe I fixed by pointing it to python3.10, though the original issue persisted.

The issue following one of the various solution is shown below, and so far has occurred with every other solution on every post with the same or a similar issue. I have not tried every single solution inexhaustibly, primarily to avoid making a worse mistake and as a result of reading various people saying such and such solution caused such and such issue, though I am at this point out of things to try.

sudo apt-get install --reinstall python3-apt Reading package lists... Done Building dependency tree... Done Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 142 not upgraded. 3 not fully installed or removed. Need to get 0 B/164 kB of archives. After this operation, 0 B of additional disk space will be used. (Reading database ... 237815 files and directories currently installed.) Preparing to unpack .../python3-apt_2.4.0ubuntu3_amd64.deb ... Unpacking python3-apt (2.4.0ubuntu3) over (2.4.0ubuntu3) ... Setting up python3-apt (2.4.0ubuntu3) ... Setting up update-notifier-common (3.192.54.8) ... Traceback (most recent call last):   File "/usr/lib/update-notifier/package-data-downloader", line 29, in <module>
    import apt_pkg ModuleNotFoundError: No module named 'apt_pkg' dpkg: error processing package update-notifier-common (--configure):  installed update-notifier-common package post-installation script subprocess returned error exit status 1 dpkg: dependency problems prevent configuration of update-notifier:  update-notifier depends on update-notifier-common (= 3.192.54.8); however:   Package update-notifier-common is not configured yet.

dpkg: error processing package update-notifier (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of update-manager: update-manager depends on update-notifier; however: Package update-notifier is not configured yet.

dpkg: error processing package update-manager (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: update-notifier-common update-notifier update-manager E: Sub-process /usr/bin/dpkg returned an error code (1)

I don't have any real idea what information would be relevant to include, so if additional information is required, or a proposition is made for attempting a previous solution and detailing the outcome, I would be more than happy to oblige. Currently the changes to sym links I have made in an attempt to resolve the issue is as stated above with python, making a sym link from /usr/bin/python3 to /usr/bin/python3.12.2, and making a sym link from /usr/lib/python3/dist-packages/apt_pkg.so to /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so. I believe I used the correct order when executing these commands, as I checked the results subsequently, but again I would be open to test anything out.

EDIT: The suggested duplicate/ solution "https://askubuntu.com/questions/1242009/modulenotfounderror-no-module-named-apt-pkg-appears-in-various-commands" does not fix my problem, with the accepted solution giving me:

Traceback (most recent call last):   File "/usr/lib/update-notifier/package-data-downloader", line 29, in <module>
    import apt_pkg ModuleNotFoundError: No module named 'apt_pkg' dpkg: error processing package update-notifier-common (--configure):  installed update-notifier-common package post-installation script subprocess returned  error exit status 1 dpkg: dependency problems prevent configuration of update-notifier:  update-notifier depends on update-notifier-common (= 3.192.54.8); however:   Package update-notifier-common is not configured yet.

dpkg: error processing package update-notifier (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of ubuntu-desktop: ubuntu-desktop depends on update-notifier; however: Package update-notifier is not configured yet.

dpkg: error processing package ubuntu-desktop (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of ubuntu-desktop-minimal: ubuntu-desktop-minimal depends on update-notifier; however: Package update-notifier is not configured yet.

dpkg: error processing package ubuntu-desktop-minimal (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of update-manager: No apport report written because the error message indicates its a followup error fro m a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because MaxReports i s reached already No apport report written because MaxReports is reached already update- manager depends on update-notifier; however: Package update-notifier is not configured yet.

dpkg: error processing package update-manager (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: update-notifier-common update-notifier ubuntu-desktop ubuntu-desktop-minimal update-manager

Neuw1
  • 13
  • 4

1 Answers1

0

If you have messed with python on purpose or by accident the result is the same. Many Ubuntu features need the exact version of Python they shipped with. If you change this you break the OS. Time to reinstall.

David DE
  • 2,316