apt-rollback 搞砸了一切,现在我无法运行 apt upgrade

apt-rollback 搞砸了一切,现在我无法运行 apt upgrade

我遇到了 libsystemd 冲突,无法修复,请帮忙!

sudo apt 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:
 apport-gtk : Depends: apport (>= 0.41) but it is not installed
 libnss-systemd : Depends: systemd (= 249.11-0ubuntu3.6)
 libsystemd0 : Breaks: libsystemd0:i386 (!= 249.11-0ubuntu3.4) but 249.11-0ubuntu3.6 is installed
 libsystemd0:i386 : Breaks: libsystemd0 (!= 249.11-0ubuntu3.6) but 249.11-0ubuntu3.4 is installed
 libudev-dev : Depends: libudev1 (= 249.11-0ubuntu3.6) but 249.11-0ubuntu3.4 is installed
 libudev1 : Breaks: libudev1:i386 (!= 249.11-0ubuntu3.4) but 249.11-0ubuntu3.6 is installed
 libudev1:i386 : Breaks: libudev1 (!= 249.11-0ubuntu3.6) but 249.11-0ubuntu3.4 is installed
 python3 : PreDepends: python3-minimal (= 3.10.6-1~22.04) but 3.10.4-0ubuntu2 is installed
           Depends: python3.10 (>= 3.10.6-1~) but 3.10.4-3ubuntu0.1 is installed
           Depends: libpython3-stdlib (= 3.10.6-1~22.04) but 3.10.4-0ubuntu2 is installed
 python3-dev : Depends: python3 (= 3.10.4-0ubuntu2) but 3.10.6-1~22.04 is installed
 systemd-timesyncd : Depends: systemd (= 249.11-0ubuntu3.6)
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:
 apport-gtk : Depends: apport (>= 0.41) but it is not installed
 libnss-systemd : Depends: systemd (= 249.11-0ubuntu3.6)
 libsystemd0 : Breaks: libsystemd0:i386 (!= 249.11-0ubuntu3.4) but 249.11-0ubuntu3.6 is installed
 libsystemd0:i386 : Breaks: libsystemd0 (!= 249.11-0ubuntu3.6) but 249.11-0ubuntu3.4 is installed
 libudev-dev : Depends: libudev1 (= 249.11-0ubuntu3.6) but 249.11-0ubuntu3.4 is installed
 libudev1 : Breaks: libudev1:i386 (!= 249.11-0ubuntu3.4) but 249.11-0ubuntu3.6 is installed
 libudev1:i386 : Breaks: libudev1 (!= 249.11-0ubuntu3.6) but 249.11-0ubuntu3.4 is installed
 python3 : PreDepends: python3-minimal (= 3.10.6-1~22.04) but 3.10.4-0ubuntu2 is installed
           Depends: python3.10 (>= 3.10.6-1~) but 3.10.4-3ubuntu0.1 is installed
           Depends: libpython3-stdlib (= 3.10.6-1~22.04) but 3.10.4-0ubuntu2 is installed
 python3-dev : Depends: python3 (= 3.10.4-0ubuntu2) but 3.10.6-1~22.04 is installed
 systemd-timesyncd : Depends: systemd (= 249.11-0ubuntu3.6)
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

答案1

您可以尝试从恢复终端删除列出的软件包。如果成功,您将删除很多很多软件包。之后,您可以使用单个命令恢复核心桌面:

sudo apt-install ubuntu-desktop-minimal

(或ubuntu-desktop,其中还包括多个用户应用程序)。

然后您就应该能够登录到您的桌面了。您的自定义 (GUI) 应用程序需要重新安装,但其外观和行为将与以前一样,因为用户数据和配置(用户和系统)已保留。

这里有关如何登录恢复终端的说明。

如果不起作用,请尝试选项 2这里。这涉及使用实时安装程序重新安装整个系统,但是采用一种特殊的方式以保留用户数据和配置。

相关内容