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
bin
bin
- Executable files
include
include
- Header files
lib
lib
- Libraries
libexec
libexec
- Executable files for internal use
The directory layout is important, because gcc
gcc
will find files in these directories by path relative to which gcc
which gcc
.
A markdown comment.
Test