我正在尝试使用命令将 Ubuntu 20.04 升级到 22.04 do-release-upgrade
。
该命令崩溃了。
如何修复?
$ 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