You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 20.04升级到22.04时do-release-upgrade命令崩溃的解决求助

Ubuntu 20.04升级到22.04时do-release-upgrade命令崩溃的解决求助

大家好,我正尝试用do-release-upgrade命令把Ubuntu 20.04升级到22.04,但这个命令直接崩溃了,有没有朋友能帮忙看看怎么解决?

我执行的命令是:

$ sudo do-release-upgrade

命令执行的输出如下:

Checking for a new Ubuntu release

Get:1 Upgrade tool signature [819 B]

Get:2 Upgrade tool [1’260 kB]

Fetched 1’261 kB in 0s (0 B/s)

authenticate 'jammy.tar.gz' against 'jammy.tar.gz.gpg'

extracting 'jammy.tar.gz'

Reading cache

Checking package manager

Reading package lists... Done

Building dependency tree

Reading state information... Done

Hit http://archive.canonical.com/ubuntu focal InRelease

Hit https://linux.teamviewer.com/deb stable InRelease

Hit http://archive.ubuntu.com/ubuntu focal InRelease

Hit http://archive.ubuntu.com/ubuntu focal-updates InRelease

Hit http://archive.ubuntu.com/ubuntu focal-backports InRelease

Hit http://archive.ubuntu.com/ubuntu focal-security InRelease

Fetched 0 B in 0s (0 B/s)

Reading package lists... Done

Building dependency tree

Reading state information... Done

nvidia-driver-535

Checking for installed snaps

Calculating snap size requirements

Updating repository information

Traceback (most recent call last):

File "/tmp/ubuntu-release-upgrader-u9ilef1o/jammy", line 8, in <module>

sys.exit(main())

File "/tmp/ubuntu-release-upgrader-u9ilef1o/DistUpgrade/DistUpgradeMain.py", line 241, in main

if app.run():

File "/tmp/ubuntu-release-upgrader-u9ilef1o/DistUpgrade/DistUpgradeController.py", line 2042, in run

return self.fullUpgrade()

File "/tmp/ubuntu-release-upgrader-u9ilef1o/DistUpgrade/DistUpgradeController.py", line 1880, in fullUpgrade

if not self.updateSourcesList():

File "/tmp/ubuntu-release-upgrader-u9ilef1o/DistUpgrade/DistUpgradeController.py", line 783, 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-u9ilef1o/Ubuntu.info'

下面是/var/log/dist-upgrade/main.log的日志片段:

2023-12-07 02:36:12,820 DEBUG Snap snap-store is installed

2023-12-07 02:36:12,820 DEBUG Snap snap-store is not tracking the release channel

2023-12-07 02:36:13,093 DEBUG Snap snapd is installed

2023-12-07 02:36:13,094 DEBUG Snap snapd is not tracking the release channel

2023-12-07 02:36:13,461 DEBUG Snap xournalpp is installed

2023-12-07 02:36:13,462 DEBUG Snap xournalpp is not tracking the release channel

2023-12-07 02:36:14,266 DEBUG MetaPkgs:

2023-12-07 02:36:16,981 DEBUG Foreign: teamviewer

2023-12-07 02:36:16,981 DEBUG Obsolete: ansible-core brave-browser brave-keyring google-chrome-stable librewolf python3-resolvelib synology-drive zoom

2023-12-07 02:36:16,981 DEBUG updateSourcesList()

2023-12-07 02:36:17,007 ERROR not handled exception:

Traceback (most recent call last):

File "/tmp/ubuntu-release-upgrader-_a0a4a4k/jammy", line 8, in <module>

sys.exit(main())

File "/tmp/ubuntu-release-upgrader-_a0a4a4k/DistUpgrade/DistUpgradeMain.py", line 241, in main

if app.run():

File "/tmp/ubuntu-release-upgrader-_a0a4a4k/DistUpgrade/DistUpgradeController.py", line 2042, in run

return self.fullUpgrade()

File "/tmp/ubuntu-release-upgrader-_a0a4a4k/DistUpgrade/DistUpgradeController.py", line 1880, in fullUpgrade

if not self.updateSourcesList():

File "/tmp/ubuntu-release-upgrader-_a0a4a4k/DistUpgrade/DistUpgradeController.py", line 783, 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-_a0a4a4k/Ubuntu.info'

2023-12-07 02:36:17,007 DEBUG running apport_crash()

补充说明:
我确认磁盘空间是足够的,以下是磁盘使用情况:

$ df -h | grep -v "/snap"

Filesystem      Size  Used Avail Use% Mounted on

udev             16G     0   16G   0% /dev

tmpfs           3.2G  2.8M  3.2G   1% /run

/dev/nvme0n1p4  239G   53G  187G  22% /

tmpfs            16G  353M   16G   3% /dev/shm

tmpfs           5.0M  4.0K  5.0M   1% /run/lock

tmpfs            16G     0   16G   0% /sys/fs/cgroup

/dev/nvme1n1p1  954G  594G  360G  63% /local

/dev/nvme0n1p5  661G  263G  399G  40% /home

/dev/nvme0n1p2  4.7G  193M  4.2G   5% /boot

/dev/nvme0n1p1   20G   31M   20G   1% /boot/efi

tmpfs           3.2G   20K  3.2G   1% /run/user/125

tmpfs           3.2G   64K  3.2G   1% /run/user/1000

我的Ubuntu版本信息:

$ cat /etc/os-release

NAME="Ubuntu"

VERSION="20.04.6 LTS (Focal Fossa)"

ID=ubuntu

ID_LIKE=debian

PRETTY_NAME="Ubuntu 20.04.6 LTS"

VERSION_ID="20.04"

HOME_URL="https://www.ubuntu.com/"

SUPPORT_URL="https://help.ubuntu.com/"

BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"

PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"

VERSION_CODENAME=focal

UBUNTU_CODENAME=focal

Python版本:

$ python3 --version

Python 3.8.10

备注:内容来源于stack exchange,提问作者norinori

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.20 11:54:30