Created
April 28, 2020 15:36
-
-
Save vvrs/9c3dc0abe7ba314f7183a0650ee9ffea to your computer and use it in GitHub Desktop.
Install different versions of gcc and g++. Update alternatives.
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
#!/bin/sh | |
sudo apt install build-essential | |
sudo apt -y install gcc-6 g++-6 gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7 | |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 | |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 | |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9 | |
# use sudo update-alternatives --config gcc/g++ to update the compiler version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment