解决Ubuntu/debian的Apt-get 由于依赖关系安装失败的问题

来源:互联网 发布:c 多线程编程 视频 编辑:程序博客网 时间:2024/05/22 10:39

我的ubuntu偶而的会升级一下软件包,结果今天装libqt4-dev时遇到下面的问题,错误提示为:

 

[php] view plaincopy
  1.  apt-get install libqt4-dev  
  2. Reading package lists... Done  
  3. Building dependency tree  
  4. Reading state information... Done  
  5. Some packages could not be installed. This may mean that you have  
  6. requested an impossible situation or if you are using the unstable  
  7. distribution that some required packages have not yet been created  
  8. or been moved out of Incoming.  
  9. The following information may help to resolve the situation:  
  10. The following packages have unmet dependencies:  
  11.   libqt4-dev: Depends: libpq-dev but it is not going to be installed  
  12.               Depends: libssl-dev but it is not going to be installed  
  13. E: Broken packages  
 

 

再往下一查,发现:

 

[php] view plaincopy
  1. # apt-get install  libpq-dev  
  2. Reading package lists... Done  
  3. Building dependency tree  
  4. Reading state information... Done  
  5. Some packages could not be installed. This may mean that you have  
  6. requested an impossible situation or if you are using the unstable  
  7. distribution that some required packages have not yet been created  
  8. or been moved out of Incoming.  
  9. The following information may help to resolve the situation:  
  10. The following packages have unmet dependencies:  
  11.   libpq-dev: Depends: libpq5 (= 8.4.1-1) but 8.4.4-0ubuntu9.10 is to be installed  
  12.              Depends: libssl-dev but it is not going to be installed  
  13.              Depends: libkrb5-dev but it is not going to be installed  
  14. E: Broken packages  
 

 

意思就是,虽然我的软件包更新,但是-dev的包就要求是那个旧一点儿的版本。。

怎么解决呢?

网上有个相关的帖子:

http://daway320.blog.163.com/blog/static/3878369920107331733393/

 

其中最有用的一句应该是这条命令:

[php] view plaincopy
  1. aptitude install libqt4-dbus=4.4.3-1  
 

这让我想起来可以用这个方法来给各个软件包降级。

比如处理libpq的问题:

apt-get install libpq5=8.4.1-1

接下来要手工降级好多库,如果再有自动化一点儿的方法就好了。 T_T
0 0
原创粉丝点击