当我这样做时,sudo apt-get -f install
我得到
Preparing to unpack .../libstdc++6_8.1.0-5ubuntu1~14.04_amd64.deb ...
Unpacking libstdc++6:amd64 (8.1.0-5ubuntu1~14.04) over (5.4.0-6ubuntu1~16.04.10) ...
dpkg: error processing archive /var/cache/apt/archives/libstdc++6_8.1.0-5ubuntu1~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.23-0ubuntu11) ...
Errors were encountered while processing:
/var/cache/apt/archives/libstdc++6_8.1.0-5ubuntu1~14.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)}
我使用的是 Ubuntu 14.04.5
这可能是因为与 libstdc++ 冲突。 (当我尝试安装 adobe acrobat 时发生)我如何/在哪里找到正确版本的 libstdc++6 以及如何卸载损坏的版本?
的输出apt-cache policy libstdc++6:i386
是
libstdc++6:i386:
Installed: 8.1.0-5ubuntu1~14.04
Candidate: 8.1.0-5ubuntu1~14.04
Version table:
*** 8.1.0-5ubuntu1~14.04 500
500 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty/main i386 Packages
100 /var/lib/dpkg/status
5.4.0-6ubuntu1~16.04.11 8500
500 http://mirror.****/ubuntu xenial-updates/main i386 Packages
5.4.0-6ubuntu1~16.04.10 500
500 http://mirror.****/ubuntu xenial-security/main i386 Packages
5.3.1-14ubuntu2 500
500 http://mirror.****/ubuntu xenial/main i386 Packages
(我在上面写****时已经截取了完整的IP地址)
$ dpkg --print-foreign-architectures is
i386
的输出dpkg -l libstdc++6
是
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-====================-===============-===============-==============================================
iU libstdc++6:amd64 5.4.0-6ubuntu1~ amd64 GNU Standard C++ Library v3
iF libstdc++6:i386 8.1.0-5ubuntu1~ i386 GNU Standard C++ Library v3
输出grep -v "#" /etc/apt/sources.list
:
deb http://mirror**/ubuntu/ xenial main restricted
deb-src http://mirror**/ubuntu/ xenial main restricted
等等。
如果我手动编辑此文件并将 xenial 更改为 trusty ,问题会得到解决吗(运行apt-get-clean
无助于解决此问题)
当我跑步时sudo apt-get install --reinstall libstdc++6:i386
,我得到:
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++-5-dev : Depends: libstdc++6 (>= 5.5.0-12ubuntu1~14.04) but 5.4.0-6ubuntu1~16.04.10 is to be installed
libstdc++6 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.10) but 5.5.0-12ubuntu1~14.04 is to be installed
Breaks: libreoffice-core (<= 1:4.4.4~rc3-0ubuntu1) but 1:4.2.8-0ubuntu5.1 is to be installed
Breaks: libstdc++6:i386 (!= 5.4.0-6ubuntu1~16.04.10) but 8.1.0-5ubuntu1~14.04 is to be installed
libstdc++6:i386 : Breaks: libstdc++6 (!= 8.1.0-5ubuntu1~14.04) but 5.4.0-6ubuntu1~16.04.10 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
apt-get -f install
由于与线程开头提到的相同原因,我无法运行。让我知道可以做什么。
答案1
看起来你的/etc/apt/sources.list
情况很糟糕。您不知何故最终在 Trusty (14.04) 系统上启用了 Xenial (16.04) 存储库。这显然会导致像这样奇怪的包冲突。
只需修复/清理您的存储库配置,运行apt-get clean
,一切就应该重新开始工作。
答案2
使用此命令删除较新的 (16.04) libstdc++6 软件包
sudo dpkg --remove --force-depends libstdc++6:amd64
从此处的软件包存储库下载 trusy (14.04) 的 libstdc++6 版本 https://launchpad.net/ubuntu/trusty/amd64/libstdc++6/4.8.2-19ubuntu1
解压包并将下载包中的 3 个文件复制到相应位置
sudo cp libstdc++.so.6.0.19 /usr/lib/x86_64-linux-gnu/
sudo cp -P libstdc++.so.6 /usr/lib/x86_64-linux-gnu/
sudo cp -P libstdc++6 /usr/share/doc/
apt-get 现在应该可以工作,重新安装 libstdc++6 以修复依赖项
sudo apt-get install --reinstall libstdc++6 sudo apt-get -f install
您现在应该恢复正常了