sudo apt list "gcc-*" | grep -P "gcc-\d+\/"
sudo apt list "g++-*" | grep -P "g++-\d+\/"
sudo apt list "gcc-*" | grep -P "gcc-\d+\/"
sudo apt list "g++-*" | grep -P "g++-\d+\/"
sudo apt list "gcc-*" | grep -P "gcc-\d+\/"
sudo apt list "g++-*" | grep -P "g++-\d+\/"
sudo apt list "gcc-*" | grep -P "gcc-\d+\/"
sudo apt list "g++-*" | grep -P "g++-\d+\/"
sudo apt-get install build-essential
sudo apt-get install build-essential
sudo apt-get install build-essential
sudo apt-get install build-essential
sudo apt-get install update-alternatives
sudo apt-get install update-alternatives
sudo apt-get install update-alternatives
sudo apt-get install update-alternatives
Using specific version of gcc
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-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-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-7 7
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7
Checking versions of configured gcc
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
GNU Toolchain Directory Layout
binbin - Executable files
includeinclude - Header files
liblib - Libraries
libexeclibexec - Executable files for internal use
The directory layout is important, because gccgcc will find files in these directories by path relative to which gccwhich gcc.
Comments