如何修复部分升级的 Ubuntu?

如何修复部分升级的 Ubuntu?

当我将 Ubuntu 从 21.10 升级到 22.04 时,遇到以下错误:

# apt dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 gdm3 : Depends: gir1.2-gdm-1.0 (= 41~rc-0ubuntu2pop0~1634915133~21.10~cf40258) but 42.0-1ubuntu6pop1~1650301427~22.04~2055533 is installed
        Depends: libgdm1 (= 41~rc-0ubuntu2pop0~1634915133~21.10~cf40258) but 42.0-1ubuntu6pop1~1650301427~22.04~2055533 is installed
 gnome-control-center : Depends: gnome-control-center-data (< 1:41) but 1:41.4-1ubuntu12pop1~1651079086~22.04~c5012df is installed
 gnome-settings-daemon : Depends: gnome-settings-daemon-common (= 40.0.1-1ubuntu3pop0~1639691325~21.10~3bcd31b) but 42.1-1ubuntu1pop0~1649081298~22.04~192b1be is installed
 libwacom2 : Depends: libwacom-common (= 1.8-2ubuntu2) but 2.2.0-1 is installed
 systemd : Depends: libsystemd0 (= 248.3-1ubuntu8.6~1650893010~21.10~9a0cd5e) but 249.11-0ubuntu3pop0~1650312774~22.04~cecf6af is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
# apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 gdm3 : Depends: gir1.2-gdm-1.0 (= 41~rc-0ubuntu2pop0~1634915133~21.10~cf40258) but 42.0-1ubuntu6pop1~1650301427~22.04~2055533 is installed
        Depends: libgdm1 (= 41~rc-0ubuntu2pop0~1634915133~21.10~cf40258) but 42.0-1ubuntu6pop1~1650301427~22.04~2055533 is installed
 gnome-control-center : Depends: gnome-control-center-data (< 1:41) but 1:41.4-1ubuntu12pop1~1651079086~22.04~c5012df is installed
 gnome-settings-daemon : Depends: gnome-settings-daemon-common (= 40.0.1-1ubuntu3pop0~1639691325~21.10~3bcd31b) but 42.1-1ubuntu1pop0~1649081298~22.04~192b1be is installed
 libwacom2 : Depends: libwacom-common (= 1.8-2ubuntu2) but 2.2.0-1 is installed
 systemd : Depends: libsystemd0 (= 248.3-1ubuntu8.6~1650893010~21.10~9a0cd5e) but 249.11-0ubuntu3pop0~1650312774~22.04~cecf6af is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

所有选项均失败。如何修复?

答案1

找到了解决方案(在连续两次遇到同样的问题后,两台笔记本电脑均从 21.10 到 22.04)

问题的唯一原因是使用 ubuntu 的 OS 升级 GUI(设置 -> OS 升级和恢复 -> OS 升级),此选项已损坏或仅适用于 Ubuntu,不适用于 Pop OS。

升级 Pop_OS 的正确方法只有 1 种,而且不通过任何 GUI:

sudo apt full-upgrade

这样做可以从头开始升级或从损坏的升级中恢复。

相关内容