Проблема с обновлением 19.04 до 19.10 "UnicodeDecodeError: кодек" utf-8 "не может декодировать байт 0x8b в позиции 1: недопустимый начальный байт

Я сделал do-release-upgrade -d и получил эту трассировку. Ранее я провел некоторые эксперименты с upgrade-alternatives, указав python - python3 и указав python3 - python3.8, но я sudo update-alternatives --remove-all python и sudo apt install --reinstall отредактировал их обоих.

$ sudo do-release-upgrade -d
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1,554 B]                                                         
Get:2 Upgrade tool [1,319 kB]                                                                  
Fetched 1,320 kB in 0s (0 B/s)                                                                 
authenticate 'eoan.tar.gz' against 'eoan.tar.gz.gpg' 
extracting 'eoan.tar.gz'

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Hit http://ca.archive.ubuntu.com/ubuntu disco InRelease                                        
Hit http://ca.archive.ubuntu.com/ubuntu disco-updates InRelease                                
Hit http://security.ubuntu.com/ubuntu disco-security InRelease                                 
Hit http://ca.archive.ubuntu.com/ubuntu disco-backports InRelease                              
Ign http://dl.google.com/linux/chrome/deb stable InRelease                                     
Hit http://dl.google.com/linux/chrome/deb stable Release                                       
Fetched 0 B in 0s (0 B/s)                                                                      
Reading package lists... Done    
Building dependency tree          
Reading state information... Done

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeQuirks.py", line 802, in _prepare_snap_replacement_data
    di.version('%s' % self.controller.fromDist).split()[0]
AttributeError: 'UbuntuDistroInfo' object has no attribute 'version'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/eoan", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeMain.py", line 238, in main
    if app.run():
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeController.py", line 2084, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeController.py", line 1921, in fullUpgrade
    if not self.doPostInitialUpdate():
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeController.py", line 927, in doPostInitialUpdate
    self.quirks.run("PostInitialUpdate")
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeQuirks.py", line 97, in run
    func()
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeQuirks.py", line 129, in eoanPostInitialUpdate
    self._calculateSnapSizeRequirements()
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeQuirks.py", line 459, in _calculateSnapSizeRequirements
    self._prepare_snap_replacement_data()
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeQuirks.py", line 808, in _prepare_snap_replacement_data
    (r.version for r in di.get_all("object")
AttributeError: 'UbuntuDistroInfo' object has no attribute 'get_all'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/problem_report.py", line 477, in add_to_existing
    self.write(f)
  File "/usr/lib/python3/dist-packages/problem_report.py", line 430, in write
    block = f.read(1048576)
  File "/usr/lib/python3.7/codecs.py", line 322, 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-ymy3ktjy/DistUpgrade/DistUpgradeQuirks.py", line 802, in _prepare_snap_replacement_data
    di.version('%s' % self.controller.fromDist).split()[0]
AttributeError: 'UbuntuDistroInfo' object has no attribute 'version'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/eoan", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeMain.py", line 238, in main
    if app.run():
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeController.py", line 2084, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeController.py", line 1921, in fullUpgrade
    if not self.doPostInitialUpdate():
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeController.py", line 927, in doPostInitialUpdate
    self.quirks.run("PostInitialUpdate")
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeQuirks.py", line 97, in run
    func()
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeQuirks.py", line 129, in eoanPostInitialUpdate
    self._calculateSnapSizeRequirements()
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeQuirks.py", line 459, in _calculateSnapSizeRequirements
    self._prepare_snap_replacement_data()
  File "/tmp/ubuntu-release-upgrader-ymy3ktjy/DistUpgrade/DistUpgradeQuirks.py", line 808, in _prepare_snap_replacement_data
    (r.version for r in di.get_all("object")
AttributeError: 'UbuntuDistroInfo' object has no attribute 'get_all'

Состояние питонов в моей системе:

$ which python
/usr/bin/python
$ ls -al $(which python)
lrwxrwxrwx 1 root root 18 Oct 19 15:05 /usr/bin/python -> /usr/bin/python2.7
$ which python3
/usr/bin/python3
$ ls -al $(which python3)
lrwxrwxrwx 1 root root 18 Oct 19 15:05 /usr/bin/python3 -> /usr/bin/python3.7
$ ls -al /usr/bin/python*
lrwxrwxrwx 1 root root      18 Oct 19 15:05 /usr/bin/python -> /usr/bin/python2.7
lrwxrwxrwx 1 root root       9 Mar  4  2019 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3691008 Oct  7 13:36 /usr/bin/python2.7
lrwxrwxrwx 1 root root      33 Oct  7 13:36 /usr/bin/python2.7-config -> x86_64-linux-gnu-python2.7-config
lrwxrwxrwx 1 root root      16 Mar  4  2019 /usr/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root      18 Oct 19 15:05 /usr/bin/python3 -> /usr/bin/python3.7
-rwxr-xr-x 2 root root 4877888 Oct  7 08:56 /usr/bin/python3.7
lrwxrwxrwx 1 root root      33 Oct  7 08:56 /usr/bin/python3.7-config -> x86_64-linux-gnu-python3.7-config
-rwxr-xr-x 2 root root 4877888 Oct  7 08:56 /usr/bin/python3.7m
lrwxrwxrwx 1 root root      34 Oct  7 08:56 /usr/bin/python3.7m-config -> x86_64-linux-gnu-python3.7m-config
-rwxr-xr-x 2 root root 4954760 Apr  3  2019 /usr/bin/python3.8
lrwxrwxrwx 1 root root      33 Apr  3  2019 /usr/bin/python3.8-config -> x86_64-linux-gnu-python3.8-config
-rwxr-xr-x 2 root root 4954760 Apr  3  2019 /usr/bin/python3.8m
lrwxrwxrwx 1 root root      34 Apr  3  2019 /usr/bin/python3.8m-config -> x86_64-linux-gnu-python3.8m-config
lrwxrwxrwx 1 root root      16 Mar 26  2019 /usr/bin/python3-config -> python3.7-config
lrwxrwxrwx 1 root root      10 Mar 26  2019 /usr/bin/python3m -> python3.7m
lrwxrwxrwx 1 root root      17 Mar 26  2019 /usr/bin/python3m-config -> python3.7m-config
lrwxrwxrwx 1 root root      14 Mar  4  2019 /usr/bin/python-config -> python2-config
6
задан 19 October 2019 в 22:23

1 ответ

У меня была та же проблема. Я решил его со следующими шагами:

  1. Откройте терминал.

  2. Введите следующие инструкции:

    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. Запустите команду:

    sudo do-release-upgrade
    
1
ответ дан 2 December 2019 в 04:35

Другие вопросы по тегам:

Похожие вопросы: