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 142not upgraded. 3 not fully installed or removed. Need to get 0 B/164 kBof archives. After this operation, 0 B of additional disk space willbe used. (Reading database ... 237815 files and directories currentlyinstalled.) 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 upupdate-notifier-common (3.192.54.8) ... Traceback (most recent calllast): File "/usr/lib/update-notifier/package-data-downloader", line29, in import apt_pkg ModuleNotFoundError: No module named 'apt_pkg' dpkg: error processing package update-notifier-common (--configure):installed update-notifier-common package post-installation scriptsubprocess returned error exit status 1 dpkg: dependency problemsprevent configuration of update-notifier: update-notifier depends onupdate-notifier-common (= 3.192.54.8); however: Packageupdate-notifier-common is not configured yet.
dpkg: error processing package update-notifier (--configure):dependency problems - leaving unconfigured dpkg: dependency problemsprevent configuration of update-manager: update-manager depends onupdate-notifier; however: Package update-notifier is not configuredyet.
dpkg: error processing package update-manager (--configure):dependency problems - leaving unconfigured No apport report writtenbecause the error message indicates its a followup error from aprevious failure.No apport report written because the error message indicates its a followup error from a previousfailure.Errors were encountered while processing: update-notifier-commonupdate-notifier update-manager E: Sub-process /usr/bin/dpkg returnedan 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.