12.04LTS 上 libc 2.17 和 libc 2.15 依赖错误混乱

12.04LTS 上 libc 2.17 和 libc 2.15 依赖错误混乱

为了解决 libc 依赖问题,我陷入了困境。我从某个地方下载了 libc6_2.17-0ubuntu5_amd64.deb 和 libc6-dev_2.17-0ubuntu5_amd64.deb,然后使用 dpkg 进行安装。从那时起,噩梦就开始了。无论如何,以下是相关输出:

> cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"


> sudo apt-cache policy libc6 locales
libc6:
  Installed: 2.17-0ubuntu5
  Candidate: 2.17-0ubuntu5
  Version table:
 *** 2.17-0ubuntu5 0
        100 /var/lib/dpkg/status
     2.15-0ubuntu10.12 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
     2.15-0ubuntu10.11 0
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     2.15-0ubuntu10 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
locales:
  Installed: 2.13+git20120306-3
  Candidate: 2.13+git20120306-3
  Version table:
 *** 2.13+git20120306-3 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status


> 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:
 libc-dev-bin : Depends: libc6 (< 2.16) but 2.17-0ubuntu5 is installed
 libc6 : Breaks: libc6:i386 (!= 2.17-0ubuntu5) but 2.15-0ubuntu10.12 is installe                                                                             d
 libc6:i386 : Breaks: libc6 (!= 2.15-0ubuntu10.12) but 2.17-0ubuntu5 is installe                                                                             d
 libc6-dev : Depends: libc6 (= 2.15-0ubuntu10.11) but 2.17-0ubuntu5 is installed
             Depends: libc-dev-bin (= 2.15-0ubuntu10.11)
 libc6-i386 : Depends: libc6 (= 2.15-0ubuntu10.12) but 2.17-0ubuntu5 is installe                                                                             d
 libnih1 : PreDepends: libc6 (< 2.16) but 2.17-0ubuntu5 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by he                                                                             ld packages.
E: Unable to correct dependencies

答案1

不要费心尝试安装 2.17。

您需要重新安装 12.04 版的特定版本的库来修复此问题。请执行以下操作:

sudo apt-get install --reinstall libc6=2.15-0ubuntu10.12 libc6-dev=2.15-0ubuntu10.12
sudo apt-get -f 安装

这应该可以解决问题。

答案2

您可以通过降级 libc6 来解决问题

$ apt-get install --reinstall libc6=2.15-0ubuntu10.15 libc6-dev=2.15-0ubuntu10.15
$ apt-get check

如果你遇到了和 Bill Z 类似的错误,请尝试以下命令

$ mkdir -p /var/backup/usr/share/doc/libc6/
$ mv /usr/share/doc/libc6/* /var/backup/usr/share/doc/libc6/
$ apt-get install --reinstall libc6=2.15-0ubuntu10.15 libc6-dev=2.15-0ubuntu10.15
$ apt-get check
$ apt-get -f install

相关内容