在 CentOS 上“卸载 Fortran”通常指的是卸载 gfortran(GNU Fortran 编译器) 或相关的 Fortran 开发包。下面按常见情况说明。
which gfortran
gfortran --version
如果显示版本信息,说明已安装。
sudo yum remove gcc-gfortran
sudo dnf remove gcc-gfortran
例如:
scl enable devtoolset-9 bash
gfortran --version
卸载方式:
sudo yum remove devtoolset-9-gcc-gfortran
(版本号根据实际情况调整)
如果是从源码 make install 的:
sudo make uninstall
which gfortran
sudo rm -f /usr/local/bin/gfortran
sudo rm -rf /usr/local/lib/gcc
如果不再需要 Fortran 开发库:
sudo yum remove gcc-gfortran libgfortran
gfortran --version
若提示 command not found,说明已卸载。
如果你说的是 Intel Fortran(ifort)、PGI Fortran 或其他商业编译器,请告诉我具体名称,我可以给你对应卸载方法。