24

I am trying to install gfortran in my computer with Ubuntu 12.04 by using these commands,

sudo -i
apt-get update
apt-get install gfortran

but I found the program saying "unable to locate package gfortran". Then on a Ubuntu page I found some question regarding the same problem and I went through the solution from them but again I couldn't install the gfortran package.

Can anybody tell me how to install it?

2
  • Take a look at This.
    – Mitch
    Oct 14, 2013 at 12:16
  • Do you get any error while running apt-get update? Can you provide the contents of /etc/apt/sources.list?
    – Salem
    Oct 14, 2013 at 12:47

1 Answer 1

31

Using sudo apt-get install gfortran should install the latest version of gfortran available for your system. Madison has a list of all versions available for all supported versions.

3
  • I couldn't get the commands you gave to work, but since you wrote this gfortran4.8 has come out. The command that worked for me was just "sudo apt-get install gfortran". But that was after I added gcc and other things.
    – AlanSE
    Nov 2, 2014 at 13:42
  • How to install 4.8? Feb 14, 2016 at 13:53
  • @ChillarAnand just install gfortran package.
    – Braiam
    Feb 14, 2016 at 20:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .