4

I am trying to update my ubuntu 18.04, but as I try to run sudo do-release-upgrade I get the following error:

Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1.554 B]                                         
Get:2 Upgrade tool [1.210 kB]                                                  
Fetched 1.212 kB in 0s (0 B/s)                                                 
authenticate 'disco.tar.gz' against 'disco.tar.gz.gpg' 
extracting 'disco.tar.gz'

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/disco", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/DistUpgrade/DistUpgradeMain.py", line 224, in main
    from .DistUpgradeController import DistUpgradeController
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/DistUpgrade/DistUpgradeController.py", line 25, in <module>
    import distro_info
ModuleNotFoundError: No module named 'distro_info'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/problem_report.py", line 497, in add_to_existing
    self.write(f)
  File "/usr/lib/python3/dist-packages/problem_report.py", line 450, in write
    block = f.read(1048576)
  File "/usr/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

Original exception was:
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/disco", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/DistUpgrade/DistUpgradeMain.py", line 224, in main
    from .DistUpgradeController import DistUpgradeController
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/DistUpgrade/DistUpgradeController.py", line 25, in <module>
    import distro_info
ModuleNotFoundError: No module named 'distro_info'

I tried installing python3-distro-info (that was already installed and up to date) and python-distro-info, which I installed but changed nothing.
What can I do to upgrade successfully?

user2759511
  • 143
  • 1
  • 4

1 Answers1

10

sudo apt-get install --reinstall python3-distro-info worked for me.

  • the above didn't work for me but this did (getting rid of my user environment): sudo su - root -c 'apt-get install --reinstall pythong3-distro-info' then sudo su - root -c do-release-upgrade – keithpjolley Feb 02 '21 at 15:25
  • I want to do this specifically for python 3.7.9 which i installed from source. How can I manage that – Murtaza Haji Mar 29 '21 at 14:16