Created
June 6, 2017 05:11
-
-
Save sdmoko/d2ce796d1516cfacab696aa54a23bf17 to your computer and use it in GitHub Desktop.
Configure gcc to using specific version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install new versions of gcc and g++ | |
sudo apt-get install gcc-5 gcc g++-5 g++ | |
#remove existing alternatives | |
sudo update-alternatives --remove-all gcc | |
sudo update-alternatives --remove-all g++ | |
#add new and old version to update-alternatives db | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50 --slave /usr/bin/g++ g++ /usr/bin/g++-5 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 | |
#choose the needed version | |
sudo update-alternatives --config gcc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment