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/
Thank you!
Able to install Gfortran-13 after completing steps above. gfortran-13 –version showed gfortran-13 present. Also tested gfortran-10 , gfortran-11 , gfortran 12. All present.
Version now on Ubuntu 22.04.4, (fresh install}
gfortran-10 10.5.6
gfortran-11 11.4.0
gfortran-12 12.3.0
gfortran-13 13.1.0
Have compiled Code with Gfortran-10,11,12. Only done minor tests with Gfortran-13. So disclaimer as to full funcionality.
def@DESKTOP-0DRJUG2:~/dev/repos/Awl$ g++ --version
gcc --versiong++ (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
def@DESKTOP-0DRJUG2:~/dev/repos/Awl$ gcc --version
gcc (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.