system says the latest version of gfortran
has been installed when I retry the sudo
command, but then i still get the command not found error for gfortran
. I'm guessing it's something to do with the directory?
I'm using a virtual machine to emulate 29~20.04.1-Ubuntu. The command:
gfortran hello.f90 -o hello
and the error:
gfortran: Command not found.
When I use sudo apt-get install gfortran
, i get: gfortran is already the newest version (4:9.3.0-1ubuntu2)
.
bash
runhash -r
. If you usezsh
runrehash
. Then try again. Does that fix it? (Or, just open a new terminal and try again.) – Kusalananda Aug 22 '21 at 11:16/old/path/to/file: no such file or directory
) – steeldriver Aug 22 '21 at 13:53zsh
shell discovers executable on shell startup (after executing one external utility), and then you can force it to do re-scan withrehash
. If you install something new without rehashing, it will not pick it up. – Kusalananda Aug 22 '21 at 14:32gfortran
. If it's not a shell hashing issue (and therefore a dupe), it's off-topic (problem went away). – Kusalananda Aug 22 '21 at 14:36