in reply to [OT] Installing g++ compiler on ubuntu-12.04LTS

You probably have added some repositories that don't match the base system; you should remove them, apt-get update and retry.

(It's been ages since I last ran across that error, so take this with a grain of salt)