无法升级到Ubuntu 21.04:“恢复原始系统状态。中止操作。”

我正在尝试安装Kubuntu 21.04,但是我遇到了一个以前从未发生过的错误:

Restoring original system state

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

我试图禁用所有的PPA,但没有成功。
这是/var/log/dist-upgrade/main.log的输出:
2021-06-06 12:03:13,081 INFO Using config files '['./DistUpgrade.cfg', '/etc/update-manager/release-upgrades.d/ubuntu-advantage-upgrades.cfg']'
2021-06-06 12:03:13,082 INFO uname information: 'Linux Ideapad 5.8.0-55-generic #62-Ubuntu SMP Tue Jun 1 08:21:18 UTC 2021 x86_64'
2021-06-06 12:03:13,638 INFO apt version: '2.1.10ubuntu0.3'
2021-06-06 12:03:13,638 INFO python version: '3.8.6 (default, May 27 2021, 13:28:02) 
[GCC 10.2.0]'
2021-06-06 12:03:13,643 INFO release-upgrader version '21.04.12' started
2021-06-06 12:03:13,655 INFO locale: 'fr_FR' 'UTF-8'
2021-06-06 12:03:13,715 INFO screen could not be run
2021-06-06 12:03:13,766 DEBUG Using 'DistUpgradeViewText' view
2021-06-06 12:03:13,820 DEBUG enable dpkg --force-overwrite
2021-06-06 12:03:13,869 DEBUG creating statefile: '/var/log/dist-upgrade/apt-clone_system_state.tar.gz'
2021-06-06 12:03:18,043 DEBUG lsb-release: 'groovy'
2021-06-06 12:03:18,044 DEBUG _pythonSymlinkCheck run
2021-06-06 12:03:18,044 DEBUG openCache()
2021-06-06 12:03:18,045 DEBUG quirks: running PreCacheOpen
2021-06-06 12:03:18,045 DEBUG running Quirks.PreCacheOpen
2021-06-06 12:03:19,006 DEBUG Comparing 5.8.0-53 with 
2021-06-06 12:03:19,006 DEBUG Comparing 5.8.0-55 with 5.8.0-53
2021-06-06 12:03:19,112 DEBUG /openCache(), new cache size 68054
2021-06-06 12:03:19,113 DEBUG need_server_mode(): run in 'desktop' mode, (because of pkg 'kubuntu-desktop')
2021-06-06 12:03:19,113 DEBUG checkViewDepends()
2021-06-06 12:03:19,118 DEBUG running doUpdate() (showErrors=False)
2021-06-06 12:03:20,448 DEBUG openCache()
2021-06-06 12:03:21,438 DEBUG Comparing 5.8.0-53 with 
2021-06-06 12:03:21,438 DEBUG Comparing 5.8.0-55 with 5.8.0-53
2021-06-06 12:03:21,550 DEBUG /openCache(), new cache size 68054
2021-06-06 12:03:21,550 DEBUG doPostInitialUpdate
2021-06-06 12:03:21,550 DEBUG quirks: running hirsutePostInitialUpdate
2021-06-06 12:03:21,551 DEBUG running Quirks.hirsutePostInitialUpdate
2021-06-06 12:03:21,552 DEBUG checking for system vendor
2021-06-06 12:05:22,081 DEBUG abort called
2021-06-06 12:05:22,083 DEBUG openCache()
2021-06-06 12:05:23,193 DEBUG Comparing 5.8.0-53 with 
2021-06-06 12:05:23,193 DEBUG Comparing 5.8.0-55 with 5.8.0-53
2021-06-06 12:05:23,318 DEBUG /openCache(), new cache size 68054

1systemctl status snapd.service 它正在运行吗? - nobody
1说实话,我查了另一个帖子,建议执行sudo apt-get purge snapd,结果真的有效! - Funeoz
3个回答

使用sudo apt-get purge snapd命令来移除snapd是解决方案。

10这在使用WSL2和以rootfs导入的Ubuntu时也适用! - JellyFilledNuts
7对我有用。这个问题阻止了我将WSL发行版从Ubuntu 18.04升级到20.04。 - Inigo
1非常感谢您的回答,这正是我所需要的解决方案。 - Morgan Blackthorne
对我也起作用 - evantkchong

我也受到了这个问题的影响。即使移除了snapd,它仍然对我产生了影响。在这个讨论串的最后一条评论中,有一个解决方法对我有效 https://github.com/microsoft/WSL/discussions/3489#discussioncomment-961901

我不得不同时移除snapd和screen!

1 - sudo apt-get purge snapd

2 - sudo apt-get purge screen

然后升级顺利进行。如果仍然失败,你可以使用cat /var/log/dist-upgrade/main.log查看导致失败的原因!


2在WSL2上使用ftw,谢谢 - watbywbarif

我只需要移除屏幕应用程序就可以了。幸运的是,不需要移除snapd。
sudo apt purge screen