Problem with upgrading 19.04 to 19.10 "UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte [duplicate]

Solution 1:

I had the same problem. I solved it with following steps:

  1. Open a terminal.

  2. Enter the following instructions:

    wget https://salsa.debian.org/debian/distro-info/raw/master/python/distro_info.py 
    sudo cp /usr/local/lib/python3.7/dist-packages/distro_info.py  /usr/local/lib/python3.7/dist-packages/distro_info.py.old
    sudo cp distro_info.py /usr/local/lib/python3.7/dist-packages/distro_info.py
    
  3. Launch the command:

    sudo do-release-upgrade
    

Solution 2:

According to https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1874250/comments/9 "this seems to typically stem from a pip-installed version of distro-info shadowing the apt version" and you can get rid of the pip-installed version with

sudo python3 -m pip uninstall distro-info 
sudo apt reinstall python3-distro-info