Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JeffLabonte/f13144fe298c44000aba0e9f0395afd8 to your computer and use it in GitHub Desktop.
Save JeffLabonte/f13144fe298c44000aba0e9f0395afd8 to your computer and use it in GitHub Desktop.
switch gcc versions in debian
#install new versions of gcc and g++
sudo apt-get install gcc-4.8 g++-4.8
#remove existing alternatives
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
#add new and old version to update-alternatives db
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-8
#choose the needed version
sudo update-alternatives --config gcc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment