Skip to content

Instantly share code, notes, and snippets.

@rebornplusplus
Created September 28, 2020 17:13
Show Gist options
  • Save rebornplusplus/424256a7d025ad17b26cd9b5055704c7 to your computer and use it in GitHub Desktop.
Save rebornplusplus/424256a7d025ad17b26cd9b5055704c7 to your computer and use it in GitHub Desktop.
Install g++-8 in Ubuntu
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-8 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-8 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-8 \
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-8 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-8
sudo update-alternatives --config gcc
# Check gcc, g++ version
gcc --version
g++ --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment