1.问题
个人情况是在使用ubuntu初始源安装terminator时,安装到某个包卡住了,于是中止了安装。后面就换了阿里的源重新安装,就出现了以下的提示
$ sudo apt install 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-7 (>= 7.4.0-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
在使用exit退出时提示 there are stopped jobs
输入 jobs -l 查询后, kill %1 结束进程1或者 fg %1 重启,顺利关闭ubuntu。
2.试着去搜索解决办法:
2.1.运气比较好的话直接更新就可以搞定,我试了后并没有用
$ sudo apt upgrade
$ sudo apt update
2.2.使用aptitude来代替apt,其在处理依赖问题上更有优势,但是我安装的ubuntu20.04并没有默认安装,于是
$ sudo apt install aptitude -f
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:
aptitude : Depends: libapt-pkg5.0 (>= 1.1) but it is not going to be installed
Recommends: libparse-debianchangelog-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
发现目前无法安装任何东西
2.3.试了这个命令也都不行
$ sudo apt update --fix-missing [package]
$ sudo apt install -f [package]
2.4.最后还是把阿里源更换回初始源(位置是/etc/apt/sources.list),然后
$ sudo apt upgrade
$ sudo apt update
$ sudo apt install terminator
3.最后居然是因为我中止安装后更换了安装源导致的,只要换回来就可以了。