web-dev-qa-db-ja.com

19.04から19.10へのアップグレードに関する問題 "UnicodeDecodeError: 'utf-8' codec't cannot be byte 0x8b in position 1:invalid start byte

do-release-upgrade -dを実行し、このトレースバックを取得しました。以前は、upgrade-alternativespython3pythonにポイントし、python3python3.8にポイントする実験をしましたが、両方ともSudo update-alternatives --remove-all pythonおよびSudo apt install --reinstalledしました。

$ 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'

私のシステムのPythonの状態は

$ 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
2
Boris

私も同じ問題を抱えていました。私は次の手順でそれを解決しました:

  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
num3ri