I use Ubuntu 14.04 with gfortran 4.8.4 and I need the version 4.9.X to compile some things... I ran the command sudo apt-get gfortran-4.9 and then gfortran --version, but I see that I have 4.8.4 installed. What could I do?

  • Get manually from here or update your sources.list at least xenial. – Ipor Sircer Nov 8 '16 at 1:17
  • 2
    Ubuntu doesn't overwrite the symlink of the default compiler version when you install additional versions from the repository - you either need to modify the symlink (manually or via the update-alternatives mechanism), or call the newer version explicitly i.e. gfortran-4.9. If whatever you're building respects it, it may be sufficient to simply set an appropriate environment variable e.g. make "FC=/usr/bin/gfortran-4.9" or export FC=/usr/bin/gfortran-4.9; make – steeldriver Nov 8 '16 at 1:33
  • @steeldriver You are right my friend! Can you write it as an asnwer please? – Joshua Salazar Nov 8 '16 at 4:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.