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. Nov 8, 2016 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 Nov 8, 2016 at 1:33
  • @steeldriver You are right my friend! Can you write it as an asnwer please? Nov 8, 2016 at 4:30


You must log in to answer this question.

Browse other questions tagged .