我的 apt-get 出了问题(Linux Mint 17)

我的 apt-get 出了问题(Linux Mint 17)

我运行 sudo apt-get dist-upgrade 时遇到问题

我得到这个输出:

    $ sudo apt-get dist-upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libstdc++6 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.4) but 5.4.1-2ubuntu1~14.04 is installed
              Breaks: libreoffice-core (<= 1:4.4.4~rc3-0ubuntu1) but 1:4.2.8-0ubuntu5.1 is installed
              Breaks: libstdc++6:i386 (!= 5.4.0-6ubuntu1~16.04.4) but 7.2.0-1ubuntu1~14.04 is installed
 libstdc++6:i386 : Breaks: libstdc++6 (!= 7.2.0-1ubuntu1~14.04) but 5.4.0-6ubuntu1~16.04.4 is installed
E: Unmet dependencies. Try using -f.

我尝试执行 sudo apt-get -f install 并得到以下结果:

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libstdc++6
The following packages will be upgraded:
  libstdc++6
1 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
3 not fully installed or removed.
Need to get 0 B/305 kB of archives.
After this operation, 501 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 370318 files and directories currently installed.)
Preparing to unpack .../libstdc++6_7.2.0-1ubuntu1~14.04_amd64.deb ...
Unpacking libstdc++6:amd64 (7.2.0-1ubuntu1~14.04) over (5.4.0-6ubuntu1~16.04.4) ...
dpkg: error processing archive /var/cache/apt/archives/libstdc++6_7.2.0-1ubuntu1~14.04_amd64.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/libstdc++6', which is different from other instances of package libstdc++6:amd64
Processing triggers for libc-bin (2.19-0ubuntu6.13) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libstdc++6_7.2.0-1ubuntu1~14.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我想我在 Linux Mint 中添加了一个错误的 ppa 指向一些 Ubuntu 的东西。另外,我可能已经为 i386 而不是 x64 架构安装了 lib6stdc++。

短篇故事:我对此完全迷失了。你能帮我解决这个问题吗?

预先感谢您的帮助 :)

答案1

Ubuntu Xenial / Mint 18 上正确的 libstdc++6 版本为 5.4.0。正在安装版本 7.2,并且与计算机上已安装的版本冲突。这意味着 libstdc++6 是从非官方 Mint/Ubuntu 存储库获取的。

首先确定它来自哪里:

$ apt-cache policy libstdc++6
libstdc++6:
  Installed: 5.4.0-6ubuntu1~16.04.4
  Candidate: 5.4.0-6ubuntu1~16.04.4
  Version table:
 *** 5.4.0-6ubuntu1~16.04.4 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
        100 /var/lib/dpkg/status
     5.3.1-14ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages

apt-cache policy的输出被简要解释在这个问题中。它为您提供不同的候选版本、已安装的版本和将要安装的版本(最高优先级)。

从这个输出中,找出 7.2 版本的来源,并注释掉相应的存储库(如果您无法选择删除存储库,您也可以降低其优先级 -- man apt_preferences)。

相关内容