ubuntu安装软件中断后,再次安装出现E: Unable to correct problems, you have held broken packages.

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.最后居然是因为我中止安装后更换了安装源导致的,只要换回来就可以了。

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值