升级到 20.04 无法安装 gnome-control-center

升级到 20.04 无法安装 gnome-control-center

我刚刚将我的 ubuntu 从 18.04 升级到 20.04,立即意识到我无法打开设置。我读到问题与 gnome-control-center 有关,但是当我使用

sudo apt install gnome-control-center

我明白了

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gnome-control-center : Depends: libcheese-gtk25 (>= 3.18.0) but it is not going to be installed
                        Depends: libcheese8 (>= 3.28.0) but it is not going to be installed
                        Depends: libgoa-backend-1.0-1 (>= 3.10.0) but it is not going to be installed
                        Recommends: gnome-online-accounts (>= 3.25.3) but it is not going to be installed
                        Recommends: gnome-user-docs but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

然后我发现了这个讨论这里并尝试按照每个提出的解决方案来解决这个未满足的依赖关系问题。不幸的是,没有任何效果。

我的下一次尝试是按照这个说明进行操作这里。因此我开始在命令中添加每个包依赖项sudo apt install,然后出现新的依赖项并重复该过程。我的最终命令是

sudo apt-get install gnome-online-accounts gnome-control-center gnome-user-docs libcheese-gtk25 libcheese8 libgoa-backend-1.0-1 libwebkit2gtk-4.0-37 ubuntu-docs yelp libclutter-1.0-0 libclutter-gtk-1.0-0 libcogl20 gstreamer1.0-clutter-3.0 libgl1 libgstreamer-gl1.0-0 libgl1-mesa-dri libglvnd0 libglx0 libglapi-mesa libglx-mesa0

输出为

    Reading package lists... Done
Building dependency tree       
Reading state information... Done
libglapi-mesa is already the newest version (20.2.0~kisak1~b).
libglvnd0 is already the newest version (1.3.2-1~kisak~b).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libgl1 : Depends: libglvnd0 (= 1.3.1-1ubuntu0.20.04.1) but 1.3.2-1~kisak~b is to be installed
 libgl1-mesa-dri : Depends: libglapi-mesa (= 20.0.8-0ubuntu1~20.04.1) but 20.2.0~kisak1~b is to be installed
 libglx-mesa0 : Depends: libglapi-mesa (= 20.0.8-0ubuntu1~20.04.1) but 20.2.0~kisak1~b is to be installed
 libglx0 : Depends: libglvnd0 (= 1.3.1-1ubuntu0.20.04.1) but 1.3.2-1~kisak~b is to be installed
E: Unable to correct problems, you have held broken packages.

之后,如果我在命令末尾添加libglvnd0and,则会得到相同的输出。我不知道下一步该怎么做,我有点绝望,非常害怕重新启动我的电脑。libglapi-mesasudo apt install

答案1

aptitude我使用删除并重新安装两个未满足的依赖项libglvnd0和解决了我的问题libglapi-mesa。我无法使用 apt 或 apt-get 删除/安装它们,但aptitude效果很好。之后,我继续使用相同的过程,将最终出现的新依赖项添加到命令中sudo apt install,并在出现问题时重新安装它们。

长话短说:

  • 如果未满足的依赖关系有如下描述:

    gnome-control-center:依赖:libcheese-gtk25(>=3.18.0)但不会安装

使用sudo apt install package1 package2安装所有依赖项同时地;如果你一个一个地安装它们,它将不起作用。

  • 否则,如果描述如下:

    libgl1:依赖:libglvnd0(= 1.3.1-1ubuntu0.20.04.1)1.3.2-1~基萨克~b将被安装

用来aptitude重新安装它们。以下命令aptitude分别安装、删除有问题的软件包并安装它。

sudo apt install aptitude
sudo aptitude remove package
sudo aptitude install package

解决这个问题后,我马上又遇到了另一个问题。我尝试重启电脑,但电脑始终无法进入登录界面。我在测试解决方案时一定不小心删除了一些重要的软件包。我通过启动恢复模式、打开 root shell 并输入以下内容解决了这个问题

sudo apt install --reinstall ubuntu-desktop

答案2

我刚刚遇到了同样的问题,通过“sudo apt remove xxx”解决了任何在句子中包含“但是”的包,因为它们比预期的“sudo apt install gnome-control-center”更新

相关内容