gfortran different versions

enter image description hereIn my Ubuntu 18.04 , default gfortran is 7.5. But default gcc version is showing 8.4. I have already installed gfortran-8.4. I need to make my default gfortran version as 8.4. How to do that?

enter image description here

1 Answer

To install gfortran version 8.4 in Ubuntu 18.04 open the terminal and type:

sudo apt install gfortran-8

You may need to use update-alternatives link to set the gfortran version if you have two or more different versions of gfortran installed. To change the default version of gfortran type:

sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-8 60
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-7 40
sudo update-alternatives --config gfortran
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like