It sounds like you don't have the GD extension installed. I don't use Ubuntu any longer, but I think it may be named php5-gd,...
The instructions @ericklan posted are on the right track, though they aren't quite clear to me and seem to recommend more than is necessary....
Find the file called: php.ini on your server and follow below steps With apache2 and php5 installed you need to make three changes in the...
Nvidia laptop, dual monitor problem in Debian
Dell docking station (D3100) not detecting monitors, We had the same issue. Make sure you install the driver