Issue
I'm running Fedora 28, and now R is throwing the error below. I'm now unable to update (or even load) certain packages.
libgfortran.so.4: cannot open shared object file: No such file or directory
I believe the problem is that Fedora now comes with a newer version of the FORTRAN compiler, which is required by these R packages.
In the following directory, I have a library libgfortran.so. I assume this is the file it's looking for but is most likely too up to date?
/usr/lib/gcc/x86_64-redhat-linux/8/libgfortran.so
'dnf info libgfortran' tells me I'm running version 8.1.1 of libgfortran (so GCC 8). Whereas I believe libgfortran.so.4 comes from GCC 7.
I tried 'dnf downgrade libgfortran', but it was just an earlier version of GCC 8.
To be honest, I'm completely lost with a way to solve this. I need R, but at the moment it's useless. Apart from waiting for the R package devs to update their Fortran compilers, is there another way I can fix this?
Solution
The answer, as Knud pointed out, is to install the older version of libgfortran alongside the newer one in Fedora.
Get libgfortran.so.4 → libgfortran4-7.2.1-1.1.1.el7.x86_64.rpm
Link here: mirror.centos.org/centos/7.5.1804/os/x86_64/Packages/…
Install : sudo dnf install ~/Downloads/libgfortran4-7.2.1-1.1.1.el7.x86_64.rpm
or if it fails with dnf try
sudo yum install ~/Downloads/libgfortran4-7.2.1-1.1.1.el7.x86_64.rpm
Answered By - nickasaurous Answer Checked By - Cary Denson (WPSolving Admin)