Super User is a question and answer site for computer enthusiasts and power users. 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

My gcc compiler is a bit outdated - gcc 4.3, so I want to build a new gcc from source since I ran apt-get update, but there were no pre-built version available yet. Has anyone experienced this process before?


share|improve this question
consider asking in ... – akira Jan 22 '11 at 6:22
up vote 5 down vote accepted

Install new version of GMP, MPFR, MPC from sources:

curl -O
tar zxf gmp-5.0.1.tar.gz
cd gmp-5.0.1/
./configure --prefix=/usr
sudo make install
cd ..

curl -O
tar zxf mpfr-3.0.0.tar.gz
cd mpfr-3.0.0/
./configure --prefix=/usr
sudo make install
cd ..

curl -O
tar zxf mpc-0.8.2.tar.gz 
cd mpc-0.8.2/
./configure --prefix=/usr
sudo make install
share|improve this answer
It is usually a better idea to install these through packages: sudo apt-get build-dep gcc-4.5 – Etienne Perot Dec 26 '11 at 6:12

You're going to want to download the source packages. You can get the from

Next you're going to want to install the package build-essentials from apt. Use the following command:

sudo apt-get install build-essential

Next you're going to want to extract the source package to its own directory:

mkdir -p ~/compiling/gcc
cd !$
tar -zxvf ~/path/to/downloaded/gcc-4.5.2.tar.gz
cd gcc-4.5.2

Then you're going to want to compile it, usually the process is as follows:

sudo make install

However, if you omit the last part you can still run the program by calling it directly, while keeping your currently installed version of gcc for normal use.

share|improve this answer

I followed these steps from GNU website and got gcc installed perfectly:

Basically, you will need to install

  • gmp-5.0.1
  • mpc-0.8.2
  • mpfr-3.0.0

and other libraries mentioned can be found under Synaptic Package Manager.

That's all

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .