Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have just installed 12.04 LTS on my laptop and I'm kinda new in this. I am required to write some program in Fortran 77 and I need a Fortran 77 compiler. I have tried installing g77 as described in the Ubuntu website but was unable to do so. I have typed in the following in terminal:

sudo apt-get install g77

and get the following:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package g77 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'g77' has no installation candidate

May I know what is the problem? I have tried searching g77 in the software center but apparently it is not there. Does this mean it is not available for 12.04?

I'm currently using an Asus K43S laptop with Intel Core i5-2450M processor and my Ubuntu is installed alongside Windows.

share|improve this question

There is GNU Fortran 95 compiler in the repositories, which can be installed using

sudo apt-get install gfortran

This is the GNU Fortran 95 compiler, which compiles Fortran 95 on platforms supported by the gcc compiler. It uses the gcc backend to generate optimized code.

If you specifically need the bleeding edge features of Fortran 77, there's f2c program which apparently can translate Fortran 77 into C.

f2c translates FORTRAN 77 (with some extensions) into C, so that it can then be compiled and run on a system with no Fortran compiler. The C files must then be linked against the appropriate libraries.

This is an actively maintained FORTRAN to C translator and with the fort77 frontend provides an ideal way to compile FORTRAN routines as black boxes (for example for invocation from C). Source level debugging facilities are not available, and error messages are not as well developed as in g77.

I'm not sure what happend to the g77 compiler - apparently it was present in older versions of Ubuntu, but not anymore, at least not in the standard repositories.

share|improve this answer

For The Fortran 95 Compiler:

sudo apt-get install gfortran

For The Fortran 77 Compiler:

sudo apt-get install fort77
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.