无法从 Ubuntu 20.04 更新到 Ubuntu 22.04

无法从 Ubuntu 20.04 更新到 Ubuntu 22.04

所以我一直在尝试更新到 Ubuntu 22.04 开发版本,但出现了某些错误。每当我尝试更新时,都会出现以下错误 ->

abc@ubuntu:~$ update-manager -d 
Checking for a new Ubuntu release
authenticate 'jammy.tar.gz' against 'jammy.tar.gz.gpg' 
extracting 'jammy.tar.gz'
No candidate ver:  chromium
No candidate ver:  microsoft-edge-stable
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-6ylluso8/jammy", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-6ylluso8/DistUpgrade/DistUpgradeMain.py", line 241, in main
    if app.run():
  File "/tmp/ubuntu-release-upgrader-6ylluso8/DistUpgrade/DistUpgradeController.py", line 2038, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-6ylluso8/DistUpgrade/DistUpgradeController.py", line 1881, in fullUpgrade
    if not self.updateSourcesList():
  File "/tmp/ubuntu-release-upgrader-6ylluso8/DistUpgrade/DistUpgradeController.py", line 784, in updateSourcesList
    self.sources = SourcesList(matcherPath=self.datadir)
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 273, in __init__
    self.matcher = SourceEntryMatcher(matcherPath)
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 470, in __init__
    dist = DistInfo(base_dir=matcherPath)
  File "/usr/lib/python3/dist-packages/aptsources/distinfo.py", line 184, in __init__
    with open(dist_fname) as dist_file:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ubuntu-release-upgrader-6ylluso8/Ubuntu.info'
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.8/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-6ylluso8/jammy", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-6ylluso8/DistUpgrade/DistUpgradeMain.py", line 241, in main
    if app.run():
  File "/tmp/ubuntu-release-upgrader-6ylluso8/DistUpgrade/DistUpgradeController.py", line 2038, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-6ylluso8/DistUpgrade/DistUpgradeController.py", line 1881, in fullUpgrade
    if not self.updateSourcesList():
  File "/tmp/ubuntu-release-upgrader-6ylluso8/DistUpgrade/DistUpgradeController.py", line 784, in updateSourcesList
    self.sources = SourcesList(matcherPath=self.datadir)
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 273, in __init__
    self.matcher = SourceEntryMatcher(matcherPath)
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 470, in __init__
    dist = DistInfo(base_dir=matcherPath)
  File "/usr/lib/python3/dist-packages/aptsources/distinfo.py", line 184, in __init__
    with open(dist_fname) as dist_file:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ubuntu-release-upgrader-6ylluso8/Ubuntu.info'

有办法解决吗?我猜是缺少了一个名为 Ubuntu.info 的文件。

编辑:@vanadium 要求我禁用第三方存储库,但结果保持不变。

abc@ubuntu:~$ sudo do-release-upgrade -d
Checking for a new Ubuntu release
Checking for a new Ubuntu release
authenticate 'jammy.tar.gz' against 'jammy.tar.gz.gpg' 
extracting 'jammy.tar.gz'
No candidate ver:  chromium
No candidate ver:  microsoft-edge-stable
No candidate ver:  pipewire-audio-client-libraries
No candidate ver:  pipewire-bin
No candidate ver:  pipewire-media-session
No candidate ver:  pipewire-pulse
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-son1yxme/jammy", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-son1yxme/DistUpgrade/DistUpgradeMain.py", line 241, in main
    if app.run():
  File "/tmp/ubuntu-release-upgrader-son1yxme/DistUpgrade/DistUpgradeController.py", line 2038, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-son1yxme/DistUpgrade/DistUpgradeController.py", line 1881, in fullUpgrade
    if not self.updateSourcesList():
  File "/tmp/ubuntu-release-upgrader-son1yxme/DistUpgrade/DistUpgradeController.py", line 784, in updateSourcesList
    self.sources = SourcesList(matcherPath=self.datadir)
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 273, in __init__
    self.matcher = SourceEntryMatcher(matcherPath)
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 470, in __init__
    dist = DistInfo(base_dir=matcherPath)
  File "/usr/lib/python3/dist-packages/aptsources/distinfo.py", line 184, in __init__
    with open(dist_fname) as dist_file:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ubuntu-release-upgrader-son1yxme/Ubuntu.info'
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.8/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-son1yxme/jammy", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-son1yxme/DistUpgrade/DistUpgradeMain.py", line 241, in main
    if app.run():
  File "/tmp/ubuntu-release-upgrader-son1yxme/DistUpgrade/DistUpgradeController.py", line 2038, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-son1yxme/DistUpgrade/DistUpgradeController.py", line 1881, in fullUpgrade
    if not self.updateSourcesList():
  File "/tmp/ubuntu-release-upgrader-son1yxme/DistUpgrade/DistUpgradeController.py", line 784, in updateSourcesList
    self.sources = SourcesList(matcherPath=self.datadir)
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 273, in __init__
    self.matcher = SourceEntryMatcher(matcherPath)
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 470, in __init__
    dist = DistInfo(base_dir=matcherPath)
  File "/usr/lib/python3/dist-packages/aptsources/distinfo.py", line 184, in __init__
    with open(dist_fname) as dist_file:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ubuntu-release-upgrader-son1yxme/Ubuntu.info'

答案1

手动操作时遇到了这个问题do-release-upgrade。在此之前,GUI 已经失败了。解决方法来自这里MarianD 的帮助帮我解决了这个问题。您需要/tmp/ubuntu-release-upgrader-*/使用 在文件夹中创建 Ubuntu.info 文件touch

例如: touch /tmp/ubuntu-release-upgrader-93aizvle/Ubuntu.info

这可能有点棘手,因为它每次运行时都会创建一个新文件夹do-distribution-upgrade,而且在你有机会输入touch新创建的文件夹的命令之前它可能会失败。太令人兴奋了!我试了 4 次。记得把“U”大写。

我强烈地感觉到,在我的系统中添加 PopOS 存储库是罪魁祸首。我这样做是为了获得 Chromium 的非 snap 版本,但结果却一团糟。我试图消除损害,但两年后,我仍然遇到一些伤疤。我看到Pop.info很多关于这个问题的答案都提到了这一点。

答案2

刚刚在网上搜索,找到了这个问题的解决方案,我的 Ubuntu 20.04 成功升级到了 22.04。解决方案可以在这里。

不要使用答案中给出的名为“Pop.info”的文件,而要创建一个名为“Ubuntu.info”的文件

相关内容