Skip to content

Instantly share code, notes, and snippets.

@akoluthic
Created September 1, 2013 13:35
Show Gist options
  • Save akoluthic/6404505 to your computer and use it in GitHub Desktop.
Save akoluthic/6404505 to your computer and use it in GitHub Desktop.
Install g++ 4.8 on Ubuntu 12.04
*Add the toolchain/test PPA*
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
*If you ever want to update symlinks for a future version:*
sudo rm /usr/bin/g++
sudo ln -s /usr/bin/g++-4.XXX /usr/bin/g++
*Check version number*
g++ --version
@koresar
Copy link

koresar commented Nov 18, 2015

I'd add -y for every apt command to make sure it runs on an automated CI.

sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update -y
sudo apt-get install -y g++-4.8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment