E: Unable to correct problems, you have held broken packages 解决方法
在Ubuntu中安装软件的时候经常碰到E: Unable to correct problems, you have held broken packages.的错误,顾名思义是因为某些软件包冲突导致,幸运的话sudo apt-get update && sudo apt-get upgrade 可以解决,但这种情况属于可遇不可求,更多的适合这么做不济于事。这样一来如何彻底解决就成了一个问题,经过多次摸索之后,将可行的解决方法记录如下:
以安装libxml2-dev时错误为例,安装时提示如下错误:
$ sudo apt-get install libxml2-dev
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:
libxml2-dev : Depends: libxml2 (= 2.7.8.dfsg-5.1ubuntu4) but 2.7.8.dfsg-5.1ubuntu4.6 is to be installed
解决方法如下:
$sudo apt-get install aptitude
$aptitude why-not libxml2
p shared-mime-info:i386 Provides shared-mime-info
p shared-mime-info:i386 Depends libxml2:i386 (>= 2.7.4)
p libxml2:i386 Breaks libxml2 (!= 2.7.8.dfsg-5.1ubuntu4)
$dpkg -l | grep libxml2
找到已经安装的对应的libxml2包
$sudo dpkg --purge --force-all libxml2
# 删除libxml2,并删除其他所有依赖包,--force-all参数很重要
$sudo apt-get -f install
# 强制安装欠缺的包
$sudo apt-get install libxml2-dev
E: Unable to correct problems, you have held broken packages 解决方法的更多相关文章
- E: Unable to correct problems, you have held broken packages
问题: apt install libmysqlclient-dev Reading package lists... DoneBuilding dependency tree Readi ...
- ubuntu 'Unable to correct problems, you have held broken packages' 错误
在用apt 安装软件时,有时会用国内的源以加快下载速度. 但是在使用ubuntu 14.04的过程中,这一过程可能会导致错误“Unable to correct problems, you have ...
- ubuntu16 安装openssh-server 一直安装不上Unable to correct problems, you have held broken packages
zengqi@zengqi:~$ sudo apt-get install openssh-server Reading package lists... DoneBuilding dependenc ...
- 解决 E: Unable to correct problems, you have held broken packages. 问题
参考: Unable to correct problems, you have held broken packages 环境 Ubuntu 14.04, 64bit 问题 在安装gcc-4.9的时 ...
- Unable to correct problems, you have held broken packages
Use aptitude instead of apt-get. It is more intelligent. It not only will handle downgrading conflic ...
- 如何解决Ubuntu下的“E: Unable to correct problems, you have held broken packages.”的问题. aptitude
今天安装build-essential时出现了以下问题,这属于包的依赖. 解决方案: 1,sudo apt-get install aptitude:完成aptitude命令安装 2,sudo apt ...
- E: Unable to correct problems, you have held broken packages-之apt-get 下载报依赖问题
今天在新来了一台ubutnu 18.04 在安装zabbix客户端是报依赖问题 root@VM_0_10:~# apt-get install zabbix-agent Reading package ...
- Unable to correct problems, you have held broken package
其实这篇接着上文(一),主要是解决samba安装的问题,中间又是一路曲折.不过这个问题也算是比较典型,有必要记录一下. #apt-get install smb* 安装失败.其实顺利的话,直接一条这样 ...
- ERROR: JDWP Unable to get JNI 1.2 environment的错误解决方法
在用java编程的时候,在debug模式下偶尔会出现下面的错误,jdk1.6.0-rc1: ERROR: JDWP Unable to get JNI 1.2 environment, jvm-> ...
随机推荐
- MyEclipse 10.7.1 最新版官网下载地址
MyEclipse 10.7.1(Windows): http://downloads.myeclipseide.com/downloads/products/eworkbench/indigo/in ...
- The file couldn't be opened because you don't have permission to view it
@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...
- Doherty Threshold
Prior to the publication of the IBM technical paper behind what commonly known today as the Doherty ...
- Android DownloadProvider学习
DownloadProvider 简介 DownloadProvider 是Android提供的DownloadManager的增强版,亮点是支持断点下载,提供了“开始下载”,“暂停下载”,“重新下载 ...
- ICA和PCA
http://wenku.baidu.com/link?url=BsmIM7T4CU1D_MgiBzu4Ul1oLnM2Qpmc0sCfXIcD9S20qq3BEkSnuY4RUc7gDZoeFR1N ...
- cocos3.12预编译android报错RuntimeJsImpl.cpp
从coco官网下载了cocos2d-x-3.12.zip,在gen-libs生成prebuilt时,mac ,ios 平台都正常,android报错: jni/../../Classes/ide-su ...
- web新内容
利用css完成如图的排版 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http: ...
- 详解java方法的重载
1.方法的重载: 方法名相同,参数列表不同就叫做方法的重载.
- WebAPI的Get和Post访问
/// <summary> /// MVC 调用webapi接口返回框架快捷按钮和一级菜单(Get) /// </summary> /// <param name=&qu ...
- php 上传大文件配置upload_max_filesize和post_max_size选项
php 上传大文件配置upload_max_filesize和post_max_size选项 (2014-04-29 14:42:11) 转载▼ 标签: php.ini upload _files[f ...