Skip to content

Instantly share code, notes, and snippets.

@devymex
Created November 5, 2020 04:00
Show Gist options
  • Save devymex/f177e606b29ec605e0fc8562528d18b0 to your computer and use it in GitHub Desktop.
Save devymex/f177e606b29ec605e0fc8562528d18b0 to your computer and use it in GitHub Desktop.
To install gcc-7 and g++-7 in ubuntu 16.04 LTS
#!/bin/bash
set -e
sudo apt update -qq
sudo apt install -yq software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update -qq
sudo apt install -yq gcc-7 g++-7
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-7 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-7 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-7 \
--slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-7 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-7 \
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-7 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment