apt安装时提示“The following packages have unmet dependencies”错误的解决方法

例如,安装gcc或python-dev时,有时会提示依赖异常。

sudo apt-get install python-dev

提示错误:
The following packages have unmet dependencies:
python-dev : Depends: libpython-dev (= 2.7.11-1) but it is not going to be installed
Depends: python2.7-dev (>= 2.7.11-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


解决方法:

1.安装aptitude
sudo apt-get install aptitude


2.利用aptitude来安装
sudo aptitude install python-dev

 


aptitude与apt-get的区别和联系
aptitude与apt-get都是Debian及其衍生系统中的包管理工具。aptitude在处理包依赖问题上更好。

 

转载于:https://www.cnblogs.com/maluscalc/p/11117827.html

你可能感兴趣的:(apt安装时提示“The following packages have unmet dependencies”错误的解决方法)