如何在 ubuntu 16.06 上安装 libgfortran.so.4

How to install libgfortran.so.4 on ubuntu 16.06

我使用的一个应用刚刚更新,它不再 运行 在我的系统上。当我尝试 运行 应用程序时,出现错误:error while loading shared libraries: libgfortran.so.4: cannot open shared object file: No such file or directory

我查看了我的系统,只有 libgfortran.so.3 可用。你知道我应该怎么做才能拥有下一个版本吗?我应该安装哪个包? (我的系统是ubuntu16.04)

这是

的逆问题

因此您必须安装 GCC 7,包括 Fortran 部分,其中包括 libgfortran 4。

在其他 StackExchange 站点上有描述如何执行此操作的答案:

您应该按照以下步骤解决问题

sudo add-apt-repository ppa:jonathonf/gcc-7.1

sudo apt-get update

sudo apt-get install gcc-7 g++-7
sudo apt-get install gfortran-7