我试图用sudo apt install gfortran在Ubuntu16.04.3上安装gfortran,但收到了以下错误消息:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed.
This may mean that you have requested an impossible situation or if you
are using the unstable distribution that some required packages have not
yet been created or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies: gfortran :
Depends: gfortran-5 (>= 5.3.1-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.我尝试过apt,智能,清洁,更新,升级和修复潜在的坏依赖都没有用。我希望用另一种方法来诊断这个问题。
发布于 2019-01-26 09:27:55
您的Ubuntu16.04.3已经很长时间没有更新了,所以您应该在尝试修复损坏的包之前进行软件更新。
sudo apt update
sudo apt upgrade在Synaptic包管理器中选择Fix断开包选项。这是一个GUI解决方案,可以很容易地处理坏包的错误消息。
运行以下命令来安装Synaptic。
sudo apt update
sudo apt install synaptic 打开Synaptic,并在Synaptic中选择编辑->修补程序包,然后第二次重复编辑->修复破碎包。
另一个简单的解决方法是从默认的Ubuntu16.04存储库中安装gfortran的旧版本,而不是当前版本5.3.1的gfortran包。打开终端并键入:
sudo apt update
sudo apt install gfortran-4.8https://askubuntu.com/questions/1113009
复制相似问题