If you are using Ubuntu or Debian based LINUX operatting system, you can use the command "apt-get" to install it from the main repository.
Enter the following commands in linux shell:
sudo apt-get update
Enter the following commands in linux shell:
sudo apt-get update
or
sudo apt-get install -y gfortran
sudo apt-get install -y gfortran
The command "sudo apt-get update" will download the packages lists from the repositories and only updates the information on the newest versions of packages and their dependencies. It does not updates any softwares. It will update the information and dependencies of all the repositories. If you to install the latest packages, you may use the command "sudo apt-get upgrade".
The command "sudo apt-get install -y gfortran" will install the gfortran in your Linux system. You may not type "sudo" if you are logged in as root.
For open suse, the name of the package is "gcc-fortran", so you may use the following command to install gfortran,
sudo zypper install gcc-fortran
sudo zypper install gcc-fortran
On Fedora or derived systems, some versions have gfortran package and some use the gcc-fortran package. So you can check the following commands to install gcc-fortran or gfortran on linux,
sudo yum install gfortran
or
sudo yum install -y gfortran
sudo yum install gfortran
or
sudo yum install -y gfortran
or
sudo yum install gcc-gfortran