在 WSL 中,do-release-upgrade 悄无声息地失败从 18.04 LTS 升级到 20.04 LTS

在 WSL 中,do-release-upgrade 悄无声息地失败从 18.04 LTS 升级到 20.04 LTS

是时候将 Ubuntu 从 18.04 升级到 20.04 了!但是我没做多大努力,进程就中止了,没有出现错误消息。有没有日志文件可以让我查看更多信息?

$ uname -a
Linux tribble 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:        18.04
Codename:       bionic

$ sudo do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1554 B]
Get:2 Upgrade tool [1340 kB]
Fetched 1342 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
Hit http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit http://archive.ubuntu.com/ubuntu bionic InRelease
Hit http://ppa.launchpad.net/maxmind/ppa/ubuntu bionic InRelease
Hit http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit https://packagecloud.io/cs50/repo/ubuntu bionic InRelease
Fetched 0 B in 0s (0 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
[LONG PAUSE]

Restoring original system state

Aborting
Reading package lists... Done
Building dependency tree
Reading state information... Done
=== Command terminated with exit status 1 (Thu Aug  5 02:10:50 2021) ===

显然,有/var/log/dist-upgrade/main.log。它只显示Quirks.focalPostInitialUpdate“调用中止”。

2021-08-05 02:08:40,403 INFO Using config files '['./DistUpgrade.cfg.bionic', '/etc/update-manager/release-upgrades.d/ubuntu-advantage-upgrades.cfg']'
2021-08-05 02:08:40,403 INFO uname information: 'Linux tribble 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64'
2021-08-05 02:08:40,852 INFO apt version: '1.6.14'
2021-08-05 02:08:40,853 INFO python version: '3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0]'
2021-08-05 02:08:40,859 INFO release-upgrader version '20.04.34' started
2021-08-05 02:08:40,866 INFO locale: 'en_US' 'UTF-8'
2021-08-05 02:08:40,948 WARNING estimate_kernel_initrd_size_in_boot() returned '0' for kernel?
2021-08-05 02:08:40,948 WARNING estimate_kernel_initrd_size_in_boot() returned '0' for initrd?
2021-08-05 02:08:40,968 DEBUG Using 'DistUpgradeViewText' view
2021-08-05 02:08:41,024 DEBUG enable dpkg --force-overwrite
2021-08-05 02:08:41,055 DEBUG creating statefile: '/var/log/dist-upgrade/apt-clone_system_state.tar.gz'
2021-08-05 02:08:43,346 DEBUG lsb-release: 'bionic'
2021-08-05 02:08:43,346 DEBUG _pythonSymlinkCheck run
2021-08-05 02:08:43,347 DEBUG openCache()
2021-08-05 02:08:43,347 DEBUG quirks: running PreCacheOpen
2021-08-05 02:08:43,347 DEBUG running Quirks.PreCacheOpen
2021-08-05 02:08:44,659 DEBUG /openCache(), new cache size 72360
2021-08-05 02:08:44,660 DEBUG need_server_mode(): can not find a desktop meta package or key deps, running in server mode
2021-08-05 02:08:44,660 DEBUG checkViewDepends()
2021-08-05 02:08:44,662 DEBUG running doUpdate() (showErrors=False)
2021-08-05 02:08:46,643 DEBUG openCache()
2021-08-05 02:08:48,077 DEBUG /openCache(), new cache size 72360
2021-08-05 02:08:48,077 DEBUG doPostInitialUpdate
2021-08-05 02:08:48,077 DEBUG quirks: running focalPostInitialUpdate
2021-08-05 02:08:48,077 DEBUG running Quirks.focalPostInitialUpdate
2021-08-05 02:10:48,996 DEBUG abort called
2021-08-05 02:10:48,998 DEBUG openCache()
2021-08-05 02:10:50,287 DEBUG /openCache(), new cache size 72360

其他文件/var/log/dist-upgrade也没有透露任何内容。


附加信息:

  • Windows 已提前更新(以防出现某些 WSL 问题)。
  • sudo apt update && sudo apt upgrade没有帮助。

答案1

我遇到了同样的问题。我以为我没有安装 snap,而且据我所知没有 PPA。检查了一下/var/log/dist-upgrade/main.log,没有错误。以下是输出:

2021-08-05 16:57:53,055 INFO Using config files '['./DistUpgrade.cfg.bionic', '/etc/update-manager/release-upgrades.d/ubuntu-advantage-upgrades.cfg']'
2021-08-05 16:57:53,055 INFO uname information: 'Linux DESKTOP-514S07G 4.4.0-19041-Microsoft #488-Microsoft Mon Sep 01 13:43:00 PST 2020 x86_64'
2021-08-05 16:57:53,586 INFO apt version: '1.6.14'
2021-08-05 16:57:53,587 INFO python version: '3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0]'
2021-08-05 16:57:53,601 INFO release-upgrader version '20.04.34' started
2021-08-05 16:57:53,648 INFO locale: 'en_US' 'UTF-8'
2021-08-05 16:57:53,820 WARNING estimate_kernel_initrd_size_in_boot() returned '0' for kernel?
2021-08-05 16:57:53,820 WARNING estimate_kernel_initrd_size_in_boot() returned '0' for initrd?
2021-08-05 16:57:53,870 DEBUG Using 'DistUpgradeViewText' view
2021-08-05 16:57:53,991 DEBUG enable dpkg --force-overwrite
2021-08-05 16:57:54,198 DEBUG creating statefile: '/var/log/dist-upgrade/apt-clone_system_state.tar.gz'
2021-08-05 16:57:56,401 DEBUG lsb-release: 'bionic'
2021-08-05 16:57:56,402 DEBUG _pythonSymlinkCheck run
2021-08-05 16:57:56,403 DEBUG openCache()
2021-08-05 16:57:56,403 DEBUG quirks: running PreCacheOpen
2021-08-05 16:57:56,403 DEBUG running Quirks.PreCacheOpen
2021-08-05 16:57:57,597 DEBUG /openCache(), new cache size 72355
2021-08-05 16:57:57,598 DEBUG need_server_mode(): can not find a desktop meta package or key deps, running in server mode
2021-08-05 16:57:57,598 DEBUG checkViewDepends()
2021-08-05 16:57:57,603 DEBUG running doUpdate() (showErrors=False)
2021-08-05 16:58:03,578 DEBUG openCache()
2021-08-05 16:58:04,857 DEBUG /openCache(), new cache size 72355
2021-08-05 16:58:04,857 DEBUG doPostInitialUpdate
2021-08-05 16:58:04,857 DEBUG quirks: running focalPostInitialUpdate
2021-08-05 16:58:04,858 DEBUG running Quirks.focalPostInitialUpdate
2021-08-05 16:58:05,643 DEBUG abort called
2021-08-05 16:58:05,644 DEBUG openCache()
2021-08-05 16:58:06,869 DEBUG /openCache(), new cache size 72355

事实证明我已经安装了 snapd,删除它就可以解决问题。

相关内容