Skip to content

Instantly share code, notes, and snippets.

@aleksseven
Created November 3, 2020 12:24
Show Gist options
  • Select an option

  • Save aleksseven/beb9673218e38f402f110dff8f1dfe1f to your computer and use it in GitHub Desktop.

Select an option

Save aleksseven/beb9673218e38f402f110dff8f1dfe1f to your computer and use it in GitHub Desktop.
1. Install dependences:
sudo apt update
sudo apt install build-essential
sudo apt-get install manpages-dev
sudo apt install software-properties-common
2. Add ppa repository:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
3. Install:
sudo apt install gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9 gcc-10 g++-10
4. Configure alternatives
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
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
5. Optional you can choose specific version of gcc:
execute this command in your terminal:
sudo update--alternatives --config gcc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment