Ubuntu – Getting + installing gcc/g++ 4.9 on Ubuntu?


How do I install the latest version of gcc and g++?

I am using a variety of C++11 and C++1y features; which is why I need this.

Best Answer

You can install close to upstream version of GCC from Ubuntu Toolchain PPA: https://wiki.ubuntu.com/ToolChain#PPA_packages

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

Tested on Ubuntu 14.04.