Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Richard Holloway's answer to this thread nicely explains how to upgrade from 4.6.3 to 4.7.0 (on 12.04, in my case) but I would like to upgrade to 4.7.1, which has been available for awhile. However there is no package g++-4.7.1 and I don't know otherwise how to do it, does anyone else?

share|improve this question
@lammilind Does this install 4.7.1? Looks like it's 4.7.0 instructions. – Matt Phillips Apr 22 '13 at 15:58
@MattPhllips, now better to install 4.8.0. Above link illustrates the process. You should change the version number according to need. – iammilind Apr 23 '13 at 3:07
up vote 3 down vote accepted

Wow, this was excruciating. Here's how I did it (NB, for a 32-bit system):

  1. $sudo apt-get install gcc-multilib

  2. $sudo apt-get install m4

  3. Download mpfr, configure, make, make install

  4. Download gmp, configure, make, make install

  5. Download mpc, configure, make, make install

  6. In order to compensate for insufficient path information, added this to .bashrc

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

export LIBRARY_PATH=/usr/lib/i386-linux-gnu export

export C_INCLUDE_PATH=/usr/include/i386-linux-gnu export

export CPLUS_INCLUDE_PATH=/usr/include/i386-linux-gnu

the former I got from here and the latter from here, modified appropriately for my install locations.

.7. Add these symlinks for the same reason:

$sudo ln -s /usr/include/i386-linux-gnu/gnu/stubs-32.h /usr/include/gnu

$sudo ln -s /usr/lib/i386-linux-gnu/crti.o /usr/lib/crti.o

$sudo ln -s /usr/lib/i386-linux-gnu/crt1.o /usr/lib/crt1.o

$sudo ln -s /usr/lib/i386-linux-gnu/crtn.o /usr/lib/crtn.o

$sudo ln -s /usr/local/lib/ /usr/lib/

.8. Download g++-4.7.1, configure, make, make install

share|improve this answer

Try to compile g++-4.7.1

List of mirrors:

Select mirror, click releases and search for gcc-4.7.1.

Download source, and compile.

share|improve this answer
Thanks, working on it--looks like there's a lot of dependencies to wade through first so it might be awhile. – Matt Phillips Jul 27 '12 at 18:29
Well, after installing gmp, mpc, and mpfr as well as gcc-multilib (to get rid of an error arising because the compiler couldn't find bits/predefs.h), now the compiler can't find gnu/stubs-32.h. The weird thing is that this seems to be a problem when compiling in 32 bit mode on a 64-bit system--however I'm doing this on a 32-bit laptop. apt-file says this is part of the libc6-dev package, but I already have the newest version installed... – Matt Phillips Jul 27 '12 at 20:07

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.