rodrigosantosbr

[Ubuntu >= 12.04] install gcc/g++ 4.7, 4.8 and 5.4.1

Dec 28th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-4.7 g++-4.7
sudo apt-get install -y gcc-4.8 g++-4.8
sudo apt-get install -y gcc-5 g++-5
update-alternatives --display gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
update-alternatives --display gcc
gcc -v

see also: http://mortenvp.com/installing-a-newer-gccg-on-ubuntu-12-04-lts/

Add Comment
Please, Sign In to add comment