How to install GD library in php?

It seems you have installed PHP via launchpad PPA:

https://launchpad.net/~ondrej/+archive/php5

Check your apt sources.list if the ppa is still active. On 14.04, you should have these repos active:

deb http://ppa.launchpad.net/ondrej/php5/ubuntu trusty main 
deb-src http://ppa.launchpad.net/ondrej/php5/ubuntu trusty main 

Explanation:

It seems you had the additional PHP-launchpad repository added before, but it was deactivated during dist-upgrade. Because of that, apt tried to install php5-gd from the standard debian repo, but this version also needs a standard php-common as dependency (which you don't have). By activating the launchpad repo again, php5-gd has been installed from there and all your other php packages should have been upgraded to the Ubuntu 14.04 ("trusty") versions from the ppa.

Tags:

Php

Ubuntu

Gd