sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-13 g++-13
ll /usr/bin/gcc-13
ll /usr/bin/g++-13
update-alternatives --display gcc
ll /etc/alternatives/g*
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10 --slave /usr/bin/g++ g++ /usr/bin/g++-13
g++ --version
gcc --version
How to choose the default gcc and g++ version?
https://askubuntu.com/questions/26498/how-to-choose-the-default-gcc-and-g-version
How to remove ‘update-alternatives’ links on Linux
https://serverfault.com/questions/838592/how-to-remove-update-alternatives-links-on-linux
GCC versions:
https://gcc.gnu.org/