无法在全新安装的 Ubuntu 20.04.3 LTS 上安装 gnome-tweaks - 未满足的依赖性问题

无法在全新安装的 Ubuntu 20.04.3 LTS 上安装 gnome-tweaks - 未满足的依赖性问题

我一直尝试gnome-tweaks在全新的 Ubuntu 20.04.3 LTS 上进行安装,但无济于事。

运行sudo apt install gnome-tweaks后输出如下:

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-tweaks : Depends: gnome-shell-extension-prefs but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

如果我尝试通过安装解决依赖性问题,gnome-shell-extension-prefs我会收到以下错误:

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-shell-extension-prefs : Depends: gnome-shell (= 3.36.1-5ubuntu1) but 3.36.9-0ubuntu0.20.04.2 is to be installed
                               Depends: gnome-shell-common (= 3.36.1-5ubuntu1) but 3.36.9-0ubuntu0.20.04.2 is to be installed
E: Unable to correct problems, you have held broken packages.

此外,运行apt-cache policy gnome-shell-extensions gnome-tweak-tool gnome-shell结果如下:

gnome-shell-extensions:
  Installed: (none)
  Candidate: 3.36.1-1
  Version table:
     3.36.1-1 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu focal/universe i386 Packages
gnome-tweak-tool:
  Installed: (none)
  Candidate: 3.34.0-2ubuntu1
  Version table:
     3.34.0-2ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu focal/universe i386 Packages
gnome-shell:
  Installed: 3.36.9-0ubuntu0.20.04.2
  Candidate: 3.36.9-0ubuntu0.20.04.2
  Version table:
 *** 3.36.9-0ubuntu0.20.04.2 500
        500 http://au.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.36.4-1ubuntu1~20.04.2 500
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
     3.36.1-5ubuntu1 500
        500 http://au.archive.ubuntu.com/ubuntu focal/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

就我的基本知识而言,这似乎是版本冲突。我搜索了很久,但找不到解决方案,似乎有相当多的人都面临这个问题。任何帮助解决此问题的帮助都将不胜感激。

答案1

gnome-tweak-tool当我尝试在最新的 Ubuntu 20.04.3 LTS(2021 年 11 月 19 日从 Ubuntu 官方网站下载)上安装时遇到了同样的问题。

发生这种情况的原因是其中一个依赖项gnome-shell-extension-prefs需要gnome-shell (= 3.36.4-1ubuntu1~20.04.2)3.36.9-0ubuntu0.20.04.2已默认安装。

为了解决这个问题,我gnome-shell使用以下代码将其依赖项降级到以前的版本:

sudo apt install gnome-shell=3.36.4-1ubuntu1~20.04.2 gnome-shell-common=3.36.4-1ubuntu1~20.04.2 gnome-shell-extension-prefs=3.36.4-1ubuntu1~20.04.2

参考

答案2

我在 Ubuntu 20.04.3 中使用同一个软件包 gnome-tweaks 时遇到了这个特定的问题(我也是 Linux 新手)。

就我个人而言,我通过将 gnome-shell 从版本 3.36.4(此 Ubuntu 版本中默认安装)降级到 synaptic 包管理器中的版本 3.36.1(sudo apt install synaptic因为它未默认安装)来解决此问题。

这可能是因为 gnome-tweaks 仅针对 gnome 3.36.1 进行了更新,而不是 Ubuntu 20.04.3 上的 3.36.4 版本。

相关内容