pkgProblemResolver::Resolve 生成​​破坏了 Ubuntu 15.10

pkgProblemResolver::Resolve 生成​​破坏了 Ubuntu 15.10

当我尝试安装某些东西时,我收到了依赖项错误并且安装了错误的 gcc-5-base 版本。

当我输入 sudo apt-get install anyprogram 时:

Reading package lists...
Building dependency tree...
Reading state information...
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 cpp-5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 ddd : Depends: libxm4 (>= 2.3.4) but it is not going to be installed
 g++-5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 gcc-5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libasan2 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libatomic1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libc-l10n : Breaks: locales (< 2.21-0experimental1) but 2.13+git20120306-21 is to be installed
 libc6-dbg : Depends: libc6 (= 2.21-6) but 2.21-0ubuntu4 is to be installed
 libc6-dev : Depends: libc6 (= 2.21-6) but 2.21-0ubuntu4 is to be installed
 libcc1-0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libcilkrts5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libgcc-5-dev : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libgcc1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libgomp1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libitm1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 liblsan0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libmpx0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libquadmath0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libstdc++-5-dev : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
 libstdc++6 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

然后我输入 sudo apt-get -f install:

Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... failed.
The following packages have unmet dependencies:
 cpp-5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 g++-5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 gcc-5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libasan2 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libatomic1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libc-l10n : Breaks: locales (< 2.21-0experimental1) but 2.13+git20120306-21 is  
installed
 libc6-dbg : Depends: libc6 (= 2.21-6) but 2.21-0ubuntu4 is installed
 libc6-dev : Depends: libc6 (= 2.21-6) but 2.21-0ubuntu4 is installed
 libcc1-0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libcilkrts5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libgcc-5-dev : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libgcc1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libgomp1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libitm1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 liblsan0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libmpx0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libquadmath0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

我尝试使用 sudo apt-get update(它可以工作,但问题仍然存在)和 sudo apt-get upgrade,但是我遇到了同样的错误:

Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... failed.
The following packages have unmet dependencies:
 cpp-5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 g++-5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 gcc-5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libasan2 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libatomic1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libc-l10n : Breaks: locales (< 2.21-0experimental1) but 2.13+git20120306-21 is  
installed
 libc6-dbg : Depends: libc6 (= 2.21-6) but 2.21-0ubuntu4 is installed
 libc6-dev : Depends: libc6 (= 2.21-6) but 2.21-0ubuntu4 is installed
 libcc1-0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libcilkrts5 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libgcc-5-dev : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libgcc1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libgomp1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libitm1 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 liblsan0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libmpx0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
 libquadmath0 : Depends: gcc-5-base (= 5.2.1-22ubuntu2) but 5.3.1-5 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

答案1

我遇到了同样的问题,并已修复。该问题发生在我手动安装了错误gcc版本之后dpkg

首先,您需要知道哪个软件包导致了依赖问题。使用dpkg -l | grep gcc从不同的软件包版本中查找错误的 gcc 软件包。 gcc-5-base对我来说是错误的版本软件包。

然后我尝试重新安装该gcc-5-base包,使用sudo apt-get install --reinstall gcc-5-base。但是此命令后出现错误。错误如下:

dpkg: error processing /var/cache/apt/archives/DEB PAKCAGENAME (--unpack):
 trying to overwrite shared '/usr/share/doc/"DIR NAME"/"FILE NAME"', which is different from other instances of package PAKCAGENAME

重命名目录名称,错误将得到修复。请参阅apt-get 错误:尝试覆盖共享的“filename”,该文件名与包“package”的其他实例不同

现在,使用sudo apt-get install --reinstall gcc-5-base获取先前版本的 gcc-5-base。

我希望这个对你有用。

相关内容