温馨提示×

ubuntu如何卸载fortran

小樊
46
2026-09-25 12:09:48
栏目: 智能运维

在 Ubuntu 上“卸载 Fortran”通常指卸载 gfortran(GNU Fortran 编译器) 或相关的 Fortran 工具链。下面按常见情况说明:


1. 卸载 gfortran(最常见)

如果你是用 apt 安装的:

sudo apt remove gfortran

如果想连配置文件一起删掉:

sudo apt purge gfortran

然后清理无用依赖:

sudo apt autoremove

2. 查看是否还有其他 Fortran 编译器

检查系统里有哪些 Fortran 相关包:

dpkg -l | grep -i fortran

常见包名:

  • gfortran
  • gfortran-11 / gfortran-12 等(特定版本)
  • libgfortran* (运行库,一般不建议删)

卸载指定版本示例:

sudo apt remove gfortran-11

3. 如果你是用 conda / 源码安装的

Conda 环境

conda remove gfortran

或从环境中移除:

conda remove -n 环境名 gfortran

源码编译安装

如果是 make install 装的,通常:

  • 回原编译目录执行:
sudo make uninstall
  • 或手动删除:
which gfortran
sudo rm /usr/local/bin/gfortran

4. 验证是否已卸载

gfortran --version

若提示 command not found 即已成功卸载。


如果你说的“Fortran”是指 某个科学计算软件(如 LAPACK、OpenCoarrays、Intel Fortran),可以告诉我具体名称,我给你精确卸载方式。

0 踩