8

I always like to have the latest version of things, particularly if that thing is gcc, g++ and there has recently been a revision to the c++ standard.

I have forgotten what ppa's I need to add to my system (I think they come from the Ubuntu organization) in order to be able to install g++-4.9.

Please could I be reminded how to complete this process, thanks.

1

2 Answers 2

11

You can get all the upstream development tools for Ubuntu 14.04 (and its derivatives) from ppa:ubuntu-toolchain-r/test

Activate it like so:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9

Source: https://wiki.ubuntu.com/ToolChain#PPA_packages

Hope this helps!

2
  • I did this, but gcc --version still returns 4.8... (idem g++ --version) Nov 18, 2016 at 18:09
  • 1
    It probably installs as g++-4.9. You could set up some symlinks in ~/bin and add it to your PATH. Nov 18, 2016 at 22:21
0

you may also need to change the symlink "g++" that points to the old library for automated scripts to use the new if that is what you want. Find the symlink g++ pointing to g++-4.8, it is probably in /usr/bin Delete it and create a new pointing to version 4.9:

sudo ln -s g++-4.9 g++

You must log in to answer this question.

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