Problemi di Python durante l'aggiornamento di Ubuntu dal 18.10 al 19.04


0

Ho Python 2.7.15+ per symlink python e Python 3.6.7 per symlink python3, quando eseguo l'aggiornamento per Ubuntu 19.04:

sudo do-release-upgrade

Restituisce alcuni errori come il seguente:

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-k7w2kx7r/disco", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeMain.py", line 238, in main
    if app.run():
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 2085, in run
    return self.fullUpgrade()
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 1906, in fullUpgrade
    if not self.askLivepatch():
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 1175, in askLivepatch
    version = next((r.version for r in di.get_all("object") if r.series == self.toDist), self.toDist)
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 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-k7w2kx7r/disco", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeMain.py", line 238, in main
    if app.run():
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 2085, in run
    return self.fullUpgrade()
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 1906, in fullUpgrade
    if not self.askLivepatch():
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 1175, in askLivepatch
    version = next((r.version for r in di.get_all("object") if r.series == self.toDist), self.toDist)
AttributeError: 'UbuntuDistroInfo' object has no attribute 'get_all'

Ho provato ad aggiornare tutti i pacchetti di Python prima di aggiornare Ubuntu:

pip freeze --local | grep -v '^-e' | cut -d = -f 1  | xargs -n1 pip install -U

È una ragione di fallimento?

Inoltre, quanto segue mostra tutti i messaggi (cinese incluso):

正在检查新版 Ubuntu
0% [执行中]                                                                     0% [正在连接 archive.ubuntu.com]                                                0% [正在连接 archive.ubuntu.com (2001:67c:1560:8001::11)]                       0% [正在连接 archive.ubuntu.com (91.189.88.162)]                                0% [已连接到 archive.ubuntu.com (2001:67c:1560:8001::11)]                       0% [正在等待报头]                                                               获取:1 升级工具签名 [1,554 B]                                                          
99% [正在等待报头]                                                              获取:2 升级工具 [1,214 kB]                                                           
100% [执行中]                                                          108 kB/s 已下载 1,215 kB / 6 (108 kB/s)                                                   
使用 'disco.tar.gz.gpg'  'disco.tar.gz' 进行验证 
正在提取 'disco.tar.gz'

正在读取缓存

正在检查软件包管理器
正在读取软件包列表... 完成  
正在分析软件包的依赖关系树        
正在读取状态信息... 完成      

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-k7w2kx7r/disco", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeMain.py", line 238, in main
    if app.run():
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 2085, in run
    return self.fullUpgrade()
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 1906, in fullUpgrade
    if not self.askLivepatch():
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 1175, in askLivepatch
    version = next((r.version for r in di.get_all("object") if r.series == self.toDist), self.toDist)
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 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-k7w2kx7r/disco", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeMain.py", line 238, in main
    if app.run():
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 2085, in run
    return self.fullUpgrade()
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 1906, in fullUpgrade
    if not self.askLivepatch():
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py", line 1175, in askLivepatch
    version = next((r.version for r in di.get_all("object") if r.series == self.toDist), self.toDist)
AttributeError: 'UbuntuDistroInfo' object has no attribute 'get_all'

Gli aggiornamenti della versione di Ubuntu presumono che la gente non abbia modificato le versioni predefinite dell'infrastruttura critica come linguaggi come Python ... il passo di preparazione prima degli aggiornamenti è quello di ripristinare tali personalizzazioni prima di eseguire l'aggiornamento della versione
Scott Stensland

Risposte:


2

Ho risolto la domanda da solo.

Trovo lo script python problematico:

/usr/local/lib/python3.6/dist-packages/distro_info.py

Quindi coprilo con:

https://salsa.debian.org/debian/distro-info/raw/master/python/distro_info.py

quindi eseguire sudo do-release-upgrade, correttamente.

Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.