无法从 Ubuntu 18.04 升级到 Ubuntu 20.04

无法从 Ubuntu 18.04 升级到 Ubuntu 20.04
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1.554 B]                                                                                                                                                                                                    
Get:2 Upgrade tool [1.341 kB]                                                                                                                                                                                                             
Fetched 1.343 kB in 0s (0 B/s)                                                                                                                                                                                                            
authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg' 
extracting 'focal.tar.gz'

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree        
Reading state information... Done

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/focal", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeMain.py", line 238, in main
    if app.run():
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeController.py", line 2089, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeController.py", line 1860, in fullUpgrade
    if not self.prepare():
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeController.py", line 431, in prepare
    self.openCache()
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeController.py", line 214, in openCache
    return self._openCache(lock)
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeController.py", line 242, in _openCache
    lock)
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeCache.py", line 144, in __init__
    self.linux_metapackage = self.quirks._get_linux_metapackage(self, False)
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeQuirks.py", line 845, in _get_linux_metapackage
    source = pkg.candidate.record['Source']
AttributeError: 'NoneType' object has no attribute 'record'
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-zu_wjdn5/focal", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeMain.py", line 238, in main
    if app.run():
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeController.py", line 2089, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeController.py", line 1860, in fullUpgrade
    if not self.prepare():
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeController.py", line 431, in prepare
    self.openCache()
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeController.py", line 214, in openCache
    return self._openCache(lock)
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeController.py", line 242, in _openCache
    lock)
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeCache.py", line 144, in __init__
    self.linux_metapackage = self.quirks._get_linux_metapackage(self, False)
  File "/tmp/ubuntu-release-upgrader-zu_wjdn5/DistUpgrade/DistUpgradeQuirks.py", line 845, in _get_linux_metapackage
    source = pkg.candidate.record['Source']
AttributeError: 'NoneType' object has no attribute 'record'

有什么想法吗?

此致!

答案1

您是否做了:

apt update && apt upgrade

你之前这样做过吗?我记得读过在尝试版本升级之前需要安装最新更新

答案2

尝试了很多选项,但清理所有 apt 源列表、重置语言环境并将已安装的 Python 版本更改为原始版本 Ubuntu 18.05(3.6)都可以正常工作,我最终可以升级到 Ubuntu 20.04。

相关内容