Celeb Glow
updates | March 28, 2026

How can I install g77 on Ubuntu 19.04?

I just downloaded Ubuntu 19.04. I want to install a program that needs the g77 compiler to run. I followed the instructions explained in Install G77 on Ubuntu >=14.04, but when typing the command

sudo apt install g77

an error appears:

E: Package 'g77' has no installation candidate

How can I fix this problem?

3

1 Answer

Package g77 is not available in any currently supported version of Ubuntu, 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. The fort77 utility is the interface to the Fortran compilation system. It will accept the full Fortran 77 language defined by the ANSI X3.9-1978 standard. fort77 can be installed in all currently supported versions of Ubuntu by running the following commands:

sudo apt update
sudo apt install fort77 

To test fort77 save this Hello world Fortran 77 code as hello-world.f:

 program hello_world implicit none
c character*32 text
c text = 'Hello World!' write (*,*) text
c end 

To compile the code run the following command:

fort77 hello-world.f -o hello-world 

This creates an executable file named hello-world. Run the program by typing ./hello-world and then press Enter.

Results:

Hello World! 

GNU Fortran 95 compiler can also be installed in all currently supported versions of Ubuntu by running the following command:

sudo apt 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. gfortran is backwards compatible with the same Hello world code example shown above, and the executable file that it generates will run. gfortran is not backwards compatible with all Fortran 77 code, so sometimes it's necessary to install fort77 for full Fortran 77 compatibility.

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