Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running ubuntu 10.04.

I just ran the command,

sudo apt-get install php5-gd

but it gave me this error

The following packages have unmet dependencies:
  php5-gd: Depends: php5-common (= 5.3.2-1ubuntu4) but 5.3.2-1ubuntu4.5 is to be installed
E: Broken packages

When tried an apt-get install on php5-common, but it says i already have the most recent version. How do i install php5-gd?

Additional Info Here's what I see after doing a sudo apt-get update | grep main

Ign lucid/main Translation-en_US
Ign stable/main Translation-en_US
Ign stable/main Translation-en_US
Hit lucid/main Packages
Hit lucid/main Sources
Get:5 stable/main Packages [1,093B]
Get:6 stable/main Packages [737B]
share|improve this question
up vote 8 down vote accepted

Update package index files(current php5-common 5.3.2-1ubuntu4.7):

$ sudo apt-get update
$ sudo apt-get install php5-gd

Check follow string in /etc/apt/sources.list:

deb lucid main restricted
deb lucid-updates main restricted
deb lucid-security main restricted


$ sudo -s
# echo "deb lucid-updates main restricted" >> /etc/apt/sources.list
# echo "deb lucid-security main restricted" >> /etc/apt/sources.list
# apt-get update
# apt-get install php5-gd
share|improve this answer
the update went fine, still getting the same error with installing php5-gd. – John Feb 23 '11 at 1:18
@John add output "apt-get update | grep main" – ooshro Feb 23 '11 at 1:29
ok, I did it and appended the output to the Additional Info in my question. Thanks ooshro! – John Feb 23 '11 at 1:51
@John You need add lucid-security and lucid-updates repository – ooshro Feb 23 '11 at 2:18
Perfect, it worked. Thanks! – John Feb 23 '11 at 2:27

you probably just forgot to do sudo apt-get update

if that doesnt work for you try sudo apt-get update && apt-get -f install

if that doesnt work either you probably messed up your sources of something

last ultima ratio which is not recommended is to force it by something like dpkg -i --force-depends-version but you should rather try to fix the issue.

without more information i unfortunately cant help you any further.

share|improve this answer
i tried running both sudo apt-get update lines which worked, but still getting the same error with the php5-gd. I'm not sure how to use the dpkg it used in conjunction with the sudo apt-get install php5-gd command? – John Feb 23 '11 at 1:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.