无法将 Ubuntu 18.04 升级到 20.04

无法将 Ubuntu 18.04 升级到 20.04

我运行 aptautoremove apt upgrade apt upgrade并得到:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

然后运行do-release-upgrade并获取

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
Hit http://us.archive.ubuntu.com/ubuntu bionic InRelease                       
Hit http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease               
Hit http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease             
Hit http://us.archive.ubuntu.com/ubuntu bionic-security InRelease              
Fetched 0 B in 0s (0 B/s)                                                      
Reading package lists... Done    
Building dependency tree          
Reading state information... Done

Restoring original system state

Aborting
Reading package lists... Done    
Building dependency tree          
Reading state information... Done

主日志中显示如下内容:

2021-02-05 11:19:03,793 INFO Using config files '['./DistUpgrade.cfg.bionic']'
2021-02-05 11:19:03,793 INFO uname information: 'Linux chas-pc 4.15.0-135-generic #139-Ubuntu SMP Mon Jan 18 17:38:24 UTC 2021 x86_64'
2021-02-05 11:19:04,128 INFO apt version: '1.6.12ubuntu0.2'
2021-02-05 11:19:04,129 INFO python version: '3.6.9 (default, Oct  8 2020, 12:12:24) 
[GCC 8.4.0]'
2021-02-05 11:19:04,131 INFO release-upgrader version '20.04.29' started
2021-02-05 11:19:04,140 INFO locale: 'en_US' 'UTF-8'
2021-02-05 11:19:04,182 INFO screen could not be run
2021-02-05 11:19:04,211 DEBUG Using 'DistUpgradeViewText' view
2021-02-05 11:19:04,252 DEBUG enable dpkg --force-overwrite
2021-02-05 11:19:04,284 DEBUG creating statefile: '/var/log/dist-upgrade/apt-clone_system_state.tar.gz'
2021-02-05 11:19:08,353 DEBUG lsb-release: 'bionic'
2021-02-05 11:19:08,353 DEBUG _pythonSymlinkCheck run
2021-02-05 11:19:08,354 DEBUG openCache()
2021-02-05 11:19:08,354 DEBUG quirks: running PreCacheOpen
2021-02-05 11:19:08,354 DEBUG running Quirks.PreCacheOpen
2021-02-05 11:19:09,476 DEBUG Comparing 4.15.0-134 with 
2021-02-05 11:19:09,476 DEBUG Comparing 4.15.0-135 with 4.15.0-134
2021-02-05 11:19:09,830 DEBUG /openCache(), new cache size 101938
2021-02-05 11:19:09,830 DEBUG need_server_mode(): run in 'desktop' mode, (because of pkg 'ubuntu-desktop')
2021-02-05 11:19:09,831 DEBUG checkViewDepends()
2021-02-05 11:19:09,832 DEBUG running doUpdate() (showErrors=False)
2021-02-05 11:19:10,951 DEBUG openCache()
2021-02-05 11:19:12,112 DEBUG Comparing 4.15.0-134 with 
2021-02-05 11:19:12,112 DEBUG Comparing 4.15.0-135 with 4.15.0-134
2021-02-05 11:19:12,471 DEBUG /openCache(), new cache size 101938
2021-02-05 11:19:12,471 DEBUG doPostInitialUpdate
2021-02-05 11:19:12,472 DEBUG quirks: running focalPostInitialUpdate
2021-02-05 11:19:12,472 DEBUG running Quirks.focalPostInitialUpdate
2021-02-05 11:21:13,735 DEBUG abort called
2021-02-05 11:21:13,735 DEBUG openCache()
2021-02-05 11:21:14,862 DEBUG Comparing 4.15.0-134 with 
2021-02-05 11:21:14,863 DEBUG Comparing 4.15.0-135 with 4.15.0-134
2021-02-05 11:21:15,215 DEBUG /openCache(), new cache size 101938

显然这里存在问题,但我不知道。有人知道是什么问题吗?

这里是输出survice snapd status(输出重复多次直到我执行 control-c):

● snapd.service - Snap Daemon
   Loaded: loaded (/lib/systemd/system/snapd.service; enabled; vendor preset: en
   Active: failed (Result: exit-code) since Fri 2021-02-05 11:00:37 CST; 22h ago
  Process: 1414 ExecStart=/usr/lib/snapd/snapd (code=exited, status=1/FAILURE)
 Main PID: 1414 (code=exited, status=1/FAILURE)

Feb 05 11:00:37 chas-pc systemd[1]: snapd.service: Service hold-off time over, s
Feb 05 11:00:37 chas-pc systemd[1]: snapd.service: Scheduled restart job, restar
Feb 05 11:00:37 chas-pc systemd[1]: Stopped Snap Daemon.
Feb 05 11:00:37 chas-pc systemd[1]: snapd.service: Start request repeated too qu
Feb 05 11:00:37 chas-pc systemd[1]: snapd.service: Failed with result 'exit-code
Feb 05 11:00:37 chas-pc systemd[1]: Failed to start Snap Daemon.
Feb 05 11:00:37 chas-pc systemd[1]: snapd.service: Triggering OnFailure= depende
lines 1-13/13 (END)

答案1

我能够升级到 20.04.02 的秘诀是删除(清除) snapd。我的程序是:

  1. 对系统和所有文件进行了备份。
  2. 在终端模式下: $ sudo apt-get purge snapd 当系统询问时,输入 y 并按 Enter 继续。这将从我的系统中删除 snapd。
  3. 清理所有剩余的依赖项$ sudo apt-get autoremove(当询问是否继续时,输入 y 并回车)
  4. 然后继续升级 Ubuntu,转到“显示应用程序”以调出“软件更新程序”,单击“升级...”,升级完成,没有问题。(请参阅上面的记录,了解如何将 snapd 确定为升级问题的根源。)

答案2

我尝试删除 snapd,但仍然不起作用。然后我退出会话screen并在普通控制台中运行它,然后它就起作用了。

相关内容