To install the g77 Fortran compiler in Ubuntu 9.10 (Karmic Koala) just follow these simple steps.
Open /etc/apt/sources.list and add the following Ubuntu 8.04 Hardy repositories:
deb http://hu.archive.ubuntu.com/ubuntu/ hardy universe
deb-src http://hu.archive.ubuntu.com/ubuntu/ hardy universe
deb http://hu.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://hu.archive.ubuntu.com/ubuntu/ hardy-updates universe
Once you’ve saved the file open a terminal and run the commands:
sudo aptitude update
sudo aptitude install g77
After g77 is installed, comment out or remove the lines above from /etc/apt/sources.list and rerun:
sudo aptitude update