ubuntu18.4安装一些软件时出现 Unable to correct problems, you have held broken packages

这几天在看《揭秘家用路由器0day漏洞挖掘技术》下了ubuntu18.4,感觉Ubuntu还是不错的,发现没有Python2(mmp),安装是出现了Unable to correct problems, you have held broken packages问题(附图一张)

1
2
3
4
5
6
7
8
9
10
11
12
13
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:
python : PreDepends: python-minimal (= 2.7.12-1~16.04) but it is not going to be installed
Depends: python2.7 (>= 2.7.12-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

查了百度许多资料都是这么说

1
2
3
$ sudo apt-get upgrade

$ sudo apt-get update

后来从这里
他这上面说aptitude解决,尝试后发现安装这个也有相同的问题,于是又用了下面的方法,成功了。
下面分享给大家:

用这条命令看你损坏的包然后卸载了

1
2
3
4
5
6
#查看包
dpkg --get-selections | grep python
#卸载
sudo apt-get remove libpython2.7
sudo apt-get remove libpython2.7-minimal
sudo apt-get remove libpython2.7-stdlib

把有关的包都卸载了,让后再

1
sudo apt-get insatll python

我这里的python是其中一个出现问题的,如果童鞋在安装软件是出现这个错误按这个方法处理。

你可能感兴趣的:(ubuntu18.4安装一些软件时出现 Unable to correct problems, you have held broken packages)