sudo apt-get -f安装失败

我认为我在混合不同的存储库包时遇到问题,但我无法卸载任何冲突的包。 有什么建议?

gunnar@gunnar-VirtualBox:~$ 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: libc6-dev-i386 The following NEW packages will be installed: libc6-dev-i386 0 upgraded, 1 newly installed, 0 to remove and 107 not upgraded. 4 not fully installed or removed. Need to get 0 B/1,151 kB of archives. After this operation, 6,337 kB of additional disk space will be used. Do you want to continue? [Y/n] y (Reading database ... 247223 files and directories currently installed.) Preparing to unpack .../libc6-dev-i386_2.19-0ubuntu6.5_amd64.deb ... Unpacking libc6-dev-i386 (2.19-0ubuntu6.5) ... dpkg: error processing archive /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.5_amd64.deb (--unpack): trying to overwrite '/usr/include/gnu', which is also in package libc6-dev-amd64 2.19-0ubuntu6.5 Errors were encountered while processing: /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.5_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) 

我相信观察到的行为是以下错误的表现:

https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1365375

我在上面提到的错误报告中提供了一个解决方法,在评论#4中:

https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1365375/comments/4

为方便起见,此文章的文字在此转载:

 To follow-up on my previous comment, I was able to work around this "broken state" in aptitude by purging the offending packages with "--force-depends": dpkg --purge --force-depends "gcc-multilib" dpkg --purge --force-depends "lib32z1-dev" dpkg --purge --force-depends "libc6-dev-x32" Now, I'm able to use "apt-get" as normal. Hopefully, this workaround won't cause problems in the future. 

不幸的是,长期的解决方案是等待Canonical的正确修复。

删除文件/var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.5_amd64.deb并再次运行sudo apt-get -f install

你有一个32位操作系统,但有libc6-dev-i386_2.19-0ubuntu6.5_amd64.deb文件,它是/var/cache/apt/archives/的64位.deb文件。 所以32位Ubuntu无法解压缩并给出错误。 简而言之,运行以下命令:

 sudo rm /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.5_amd64.deb sudo apt-get -f install 

/usr/include/gnu被其他包中的文件覆盖时,删除该包将解决您的问题。

运行以下命令以摆脱这种情况。

 sudo apt-get purge libc6-dev-i386 sudo apt-get autoremove sudo apt-get clean sudo apt-get install -f