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-> ...
随机推荐
- Excel顺序生成序号,不能有数字4出现
A1填写:1 A2填写:=--SUBSTITUTE(A1+1,4,5) 然后下拉A3之后的单元格 需求应用场合:生成员工序号忌讳出现4的.
- Python 3.5 RuntimeError: can't start new thread
/*********************************************************************** * Python 3.5 RuntimeError: ...
- (原创)MongoDB之NoSQL简介
Nosql简介1.1系统对数据的需求 Nosql[Nosql主要用途大数据处理]的全称为”not only sql”,为非关系型数据库[非关系型数据库就是关系型数据库的所有特点都没有了, ...
- Android之自定义控件-下拉刷新
实现效果: 图片素材: --> 首先, 写先下拉刷新时的刷新布局 pull_to_refresh.xml: <resources> <string name=& ...
- 105 董婷婷 第一次Sprint总结
总结: 经过一个多星期,第一次Sprint在今天结束了,在这次Sprint中我们的工作主要做的是对项目的构建及各种界面的设计和完善,一些比较具体的功能还没有实现.在这次Sprint中因为有上学期合作的 ...
- WebView 载入本地的html
1.可以是用loadData,这种方法需要先将html文件读取出来,以字符串传入loadData,可以展示页面,但是不会引用css.js等文件. 2.使用loadUrl,不过需要注意,这里因为是使用本 ...
- tomcat7 Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete
参考连接: http://lucasterdev.altervista.org/wordpress/2012/05/12/could-not-load-the-tomcat-server-config ...
- 在laravel下關於blade模板的嘗試
Blade模板 關於模板繼承和分區段 @section和@yield的實驗 ①關於@section...@show嘗試 測試1 {{--appV2test.blade.php--}} <html ...
- Thread系列之Thread.Sleep(0)
线程这一概念,可以理解成进程中的一个小单元.这个单元是一个独立的执行单元,但是与进程中的其他线程共享进程中的内存单元. 由于Cpu资源是有限的,所以进程中的多个线程要抢占Cpu,这也导致进程中的多个线 ...
- 数据库备份Sql
今天学习心得: 数据库备份语句: backup database ZhiHuiGongDi To disk = 'D:\zhihuigongdi20150824.bak'