0

So I did an upgrade form ubuntu 20.04 to 22.04 which did not quite go perfectly and there were some issues. While doing a sudo apt-get upgrade I am getting the following message

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:
 libpython3-stdlib : Depends: libpython3.10-stdlib (>= 3.10.6-1~) but it is not installed
 python3-update-manager : Depends: python3-distupgrade but it is not installed
 python3.10 : Depends: libpython3.10-stdlib (= 3.10.13-1+focal1) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Then when I did a sudo apt --fix-broken install I got the following message

The following packages will be REMOVED:
  libpython3-stdlib lsb-release python3 python3-apt python3-distro-info python3-pkg-resources python3-update-manager
  python3-xkit python3-yaml python3.10 ubuntu-advantage-tools
0 upgraded, 0 newly installed, 11 to remove and 10 not upgraded.
After this operation, 4,073 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 261415 files and directories currently installed.)
Removing ubuntu-advantage-tools (28.1~22.04) ...
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/usr/lib/python3/dist-packages/uaclient/apt.py", line 14, in <module>
    import apt  # type: ignore
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 26, in <module>
    from apt.package import Package as Package, Version as Version
  File "/usr/lib/python3/dist-packages/apt/package.py", line 32, in <module>
    from http.client import BadStatusLine
ModuleNotFoundError: No module named 'http'
dpkg: error processing package ubuntu-advantage-tools (--remove):
 installed ubuntu-advantage-tools package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
/usr/sbin/policy-rc.d returned 101, not running 'start ua-timer.timer'
/usr/sbin/policy-rc.d returned 101, not running 'start ubuntu-advantage.service'
Errors were encountered while processing:
 ubuntu-advantage-tools
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

I think there were some issues with dkpg package which is probably causing this issue. I tried to fix it using methods mentioned in other posts about dkpg but no luck. I am not very good with linux os either. Any help to resolve this would be highly appreciated!

APaul31
  • 11

1 Answers1

1

The main issue here is with ubuntu-advantage-tools as can be noted from this line Removing ubuntu-advantage-tools (28.1~22.04) So after a couple of days of googling I found this helpful post Broken update and package mess: how do I remove old packages manually? which helped to resolve the issue. Essentially running the sudo mv command and then a bunch of times sudo apt --fix-broken install and sudo apt update, sudo apt upgrade, sudo apt autoremove removed most of the issues

But there were still some issues with libpython3.10-stdlib package which was not getting sorted out. Then I cam acorss another helpful post Unmet dependencies for python 3.10 and followed the instructions and then folowed up with the update, upgrade and autoremove command and that sorted out all the existing issues. All packages are upto date now

APaul31
  • 11