简体   繁体   中英

install GD library in ubuntu Unmet dependancies

Hi guys I am trying to insall php GD library by using command. 命令 php GD库。 But it says unmet dependencies. Here is the output.

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.

Any help??

Check your repositories

cat /etc/apt/sources.list

if you have no different versions, try to update packages list:

sudo apt-get update

and than try to install php5-gd

Check if it exist in /etc/apt/preferences.d/php5_3 file ...

I've added the following:

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

After that:

apt-get update
apt-get install php5-gd

Check with:

php -m |grep gd

Restart your apache.

Try to use aptitude command instead of apt-get, which deals with dependencies better than apt-get: sudo aptitude install php5-gd It should help you downgrade the bothering package.

(Answer from maverickaddicted on http://ubuntuforums.org )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM