我试图使用pecl获取php apc软件包,并遇到一个我认为可能是由OpenVZ引起的问题。 为此,我需要php5-dev。 当我尝试通过apt-get安装它时,我得到这个:
php5-dev : Depends: libssl-dev but it is not going to be installed Depends: libtool (>= 2.2) but it is not going to be installed
当我尝试手动安装依赖项(没有成功),我相信我已经确定libc6-dev为罪魁祸首。
libc6-dev : Depends: libc6 (= 2.15-0ubuntu10.2) but 2.15-0ubuntu10+openvz0 is to be installed
我已经在系统上安装了libc6。 如果这里有任何帮助是我的sources.list:
deb http://archive.ubuntu.com/ubuntu precise main restricted universe deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse deb http://archive.canonical.com/ubuntu precise partner
这是一个非常令人沮丧的问题,因为我还有其他的Ubuntu 12.04在其他地方运行得很好(虽然不在OpenVZ上)。
简单的修复,你需要做的是指定你想安装的libc6-dev的版本(在这种情况下,openvz的),它会安装正常。
如何弄清楚你想要什么,好吧,说你要做的
apt-get install libc6-dev Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: libc6-dev : Depends: libc6 (= 2.15-0ubuntu10.4) but 2.15-0ubuntu10+openvz0 is to be installed Recommends: gcc but it is not going to be installed or c-compiler E: Unable to correct problems, you have held broken packages.
在这种情况下,您希望它安装2.15-0ubuntu10 + openvz0版本,再次尝试指定这样的版本(现在注意行末的=版本):
apt-get install libc6-dev=2.15-0ubuntu10+openvz0 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: libc6-dev : Depends: libc-dev-bin (= 2.15-0ubuntu10+openvz0) Recommends: gcc but it is not going to be installed or c-compiler E: Unable to correct problems, you have held broken packages.
正如你在这里看到的那样,最终还是需要一个“openvz”版本的包,所以我只是把这个包加到apt-get安装线上,再次指定了版本
apt-get install libc6-dev=2.15-0ubuntu10+openvz0 libc-dev-bin=2.15-0ubuntu10+openvz0 Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: gcc gcc-4.6 libquadmath0 linux-libc-dev manpages-dev Suggested packages: gcc-multilib autoconf automake1.9 libtool flex bison gdb gcc-doc gcc-4.6-multilib libmudflap0-4.6-dev gcc-4.6-doc gcc-4.6-locales libgcc1-dbg libgomp1-dbg libquadmath0-dbg libmudflap0-dbg binutils-gold glibc-doc The following NEW packages will be installed: gcc gcc-4.6 libc-dev-bin libc6-dev libquadmath0 linux-libc-dev manpages-dev 0 upgraded, 7 newly installed, 0 to remove and 4 not upgraded. Need to get 13.6 MB of archives. After this operation, 33.5 MB of additional disk space will be used. Do you want to continue [Y/n]?
现在它工作!
希望这有助于你,我自己碰到几次,并知道如何正确地解决它可以帮助很多,有其他方法来解决这个错误,但这是'正确'的方式。