在ubuntu Unmet依赖项中安装GD库

时间:2013-12-20 08:39:47

标签: php ubuntu

大家好我正在尝试使用 sudo apt-get install php5-gd 命令安装php GD库。但它表示未满足的依赖关系。这是输出。

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:
php5-gd : Depends: php5-common (= 5.4.6-1ubuntu1) but 5.4.6-1ubuntu1.2 is to be installed
E: Unable to correct problems, you have held broken packages.

任何帮助??

3 个答案:

答案 0 :(得分:2)

检查您的存储库

cat /etc/apt/sources.list

如果您没有不同的版本,请尝试更新包列表:

sudo apt-get update

并尝试安装php5-gd

答案 1 :(得分:0)

检查/etc/apt/preferences.d/php5_3文件中是否存在...

我添加了以下内容:

Package: php5-gd
Pin: release a=precise
Pin-Priority: 991

之后:

apt-get update
apt-get install php5-gd

检查:

php -m |grep gd

重启你的apache。

答案 2 :(得分:0)

尝试使用aptitude命令而不是apt-get,它比apt-get更好地处理依赖关系: sudo aptitude install php5-gd 它应该可以帮助你降低打扰包的速度。

(来自http://ubuntuforums.org的maverickaddicted的答案)