Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zavorka/71f241a9168b54c72408aa64f10f2697 to your computer and use it in GitHub Desktop.
Save zavorka/71f241a9168b54c72408aa64f10f2697 to your computer and use it in GitHub Desktop.
Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial

Run the following in the terminal:

Install the gcc-7 packages:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

Set it up so the symbolic links gcc, g++ point to the newer version:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 \
                         --slave /usr/bin/g++ g++ /usr/bin/g++-7 
sudo update-alternatives --config gcc
gcc --version
g++ --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment