sudo apt-get install 得到 Unmet 依赖项结果

sudo apt-get install 得到 Unmet 依赖项结果

我遇到了这个错误Linux ubuntu 4.4.0-198-generic #230-Ubuntu SMP Sat Nov 28 01:30:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$ sudo apt-get -f install`
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 cpp-6 : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 g++-6 : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 g++-6-multilib : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 gcc-6 : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 gcc-6-multilib : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 lib32asan3 : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 lib32cilkrts5 : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 lib32gcc-6-dev : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 lib32stdc++-6-dev : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 lib32ubsan0 : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 libasan3 : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 libc6 : Breaks: libc6:i386 (!= 2.23-0ubuntu11.2) but 2.23-0ubuntu3 is installed
 libc6:i386 : Breaks: libc6 (!= 2.23-0ubuntu3) but 2.23-0ubuntu11.2 is installed
 libcilkrts5 : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
 libgcc-6-dev : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
            Depends: libgcc1 (>= 1:6.2.0-3ubuntu11~12.04) but 1:6.0.1-0ubuntu1 is installed
 libgcc1 : Breaks: libgcc1:i386 (!= 1:6.0.1-0ubuntu1) but 1:9.3.0-10ubuntu2~12.04 is installed
 libgcc1:i386 : Breaks: libgcc1 (!= 1:9.3.0-10ubuntu2~12.04) but 1:6.0.1-0ubuntu1 is installed
 libstdc++-6-dev : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
               Depends: libstdc++6 (>= 6.2.0-3ubuntu11~12.04) but 5.4.0-6ubuntu1~16.04.12 is installed
 libstdc++6 : Breaks: libstdc++6:i386 (!= 5.4.0-6ubuntu1~16.04.12) but 9.3.0-10ubuntu2~12.04 is installed
 libstdc++6:i386 : Breaks: libstdc++6 (!= 9.3.0-10ubuntu2~12.04) but 5.4.0-6ubuntu1~16.04.12 is installed
 libubsan0 : Depends: gcc-6-base (= 6.2.0-3ubuntu11~12.04) but 6.0.1-0ubuntu1 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

我尝试更新:

$ sudo apt-get install updata
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package updata
$ sudo apt update
     Hit:1 http://tw.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://tw.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://tw.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:4 http://dl.ajaxplorer.info/repos/apt squeeze InRelease [7,126 B]
Err:4 http://dl.ajaxplorer.info/repos/apt squeeze InRelease
  The following signatures were invalid: KEYEXPIRED 1530185191
Hit:5 http://security.ubuntu.com/ubuntu xenial-security InRelease
Reading package lists... Done
W: Target Packages (main/binary-amd64/Packages) is configured multiple     times in /etc/apt/sources.list:47 and /etc/apt/sources.list:54
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:47 and /etc/apt/sources.list:54
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:47 and /etc/apt/sources.list:54
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:47 and /etc/apt/sources.list:54
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:47 and /etc/apt/sources.list:54
W: http://dl.ajaxplorer.info/repos/apt/dists/squeeze/InRelease: Signature by key E570B40867757573C52F115D062C7EBC11FFD694 uses weak digest algorithm (SHA1)
W: GPG error: http://dl.ajaxplorer.info/repos/apt squeeze InRelease: The following signatures were invalid: KEYEXPIRED 1530185191
E: The repository 'http://dl.ajaxplorer.info/repos/apt squeeze InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:47 and /etc/apt/sources.list:54
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:47 and /etc/apt/sources.list:54
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:47 and /etc/apt/sources.list:54
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:47 and /etc/apt/sources.list:54
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:47 and /etc/apt/sources.list:54
$ apt-key adv --keyserver pool.sks-keyservers.net --recv-keys E570B40867757573C52F115D062C7EBC11FFD694
Executing: /tmp/tmp.NXrgNdYHtv/gpg.1.sh --keyserver
pool.sks-keyservers.net
--recv-keys
E570B40867757573C52F115D062C7EBC11FFD694
gpg: requesting key 11FFD694 from hkp server pool.sks-keyservers.net
gpg: key 11FFD694: "Charles du Jeu (AjaXplorer Team) <[email protected]>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

我该如何解决这个问题?

答案1

有几个问题正在发生:

1)

Err:4 http://dl.ajaxplorer.info/repos/apt squeeze InRelease
  The following signatures were invalid: KEYEXPIRED 1530185191

例如,参见更新存储库时出现 GPG KEYEXPIRED 错误

如果您无法使用 获取此存储库的当前公钥apt-key,则需要查看您的设置期望密钥位于何处。使用apt-key当前已逐步淘汰,取而代之的是将单个密钥存储在文件系统中。

在 中的某个位置查找deb与此存储库相对应的条目/etc/apt。如果此条deb目中有类似内容[signed-by=/usr/share/keyrings/<myrepository>-archive-keyring.gpg],则需要使用当前密钥刷新其中提到的文件。存储库描述中可能有关于如何下载密钥的说明。

2)

update,不是updata;) 此外,没有名为update(或updata)的软件包,因此您无法安装它。这是您的系统在 中告诉您的E: Unable to locate package updata。您可能想再次查看 的系统apt,这样您就不会遇到基本上毫无意义(无意冒犯)的事情,例如sudo apt-get install updataagain。

3)

您似乎配置了一些提供一些您需要但不需要的软件包全部其中。例如,当您尝试安装时cpp-6,它还需要。对于您gcc-6-base的版本cpp-6有可用,您需要gcc-6-base 6.2.0-3ubuntu11~12.04,但您只有gcc-6-base 6.0.1-0ubuntu1

4)

正如 guiverc 在对你的问题的评论中提到的那样,你似乎至少使用了一些相当老旧的软件。如您所见,gcc-6-base您要安装的软件包(如果有的话)适用于 Ubuntu 12.04,因此是 2012 年的。

总的来说,您可能需要对您的机器进行一次彻底的春季大扫除。也许请人亲自检查一下会有所帮助,如果可以的话,也许可以请您当地的 Linux 用户组的人来检查。最终,备份所有要保留的数据并进行全新安装甚至可能更容易。但这并不容易远程决定。

相关内容