1.1

debian系统解决包依赖问题的神器aptitude

最近在玩OPI的时候遇到了一个包因为各种依赖问题死活装不上.苦搜很久找到这个aptitude.
基于debain衍生的各种操作系统比较常用包管理器是apt,不过apt在遇到依赖问题的时候处理得不是很好.

就像这样:

The following packages have unmet dependencies:
 build-essential : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
 g++ : Depends: g++-4.9 (>= 4.6.4-1~) but it is not going to be installed
 libboost-dev : Depends: libboost1.55-dev but it is not going to be installed
 libfreetype6-dev : Depends: libc6-dev but it is not going to be installed or
                             libc-dev
 libncurses5-dev : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
 libpam0g-dev : Depends: libc6-dev but it is not going to be installed or
                         libc-dev
 libpcre3-dev : Depends: libc6-dev but it is not going to be installed
 libpng12-dev : Depends: libpng12-0 (= 1.2.50-2+deb8u3) but 1.2.51-0ubuntu3 is to be installed
 libxml2-dev : Depends: libxml2 (= 2.9.1+dfsg1-5+deb8u6) but 2.9.2+dfsg1-3 is to be installed
 zlib1g-dev : Depends: zlib1g (= 1:1.2.8.dfsg-2) but 1:1.2.8.dfsg-2ubuntu1 is to be installed
              Depends: libc6-dev but it is not going to be installed or
                       libc-dev
E: Unable to correct problems, you have held broken packages.

apt会报个错然后就不管了,你自己解决

而aptitude会自动找出包依赖的问题,给提供解决方案:

The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.19-18+deb8u10) but 2.21-0ubuntu4 is installed.
 libc-dev-bin : Depends: libc6 (< 2.20) but 2.21-0ubuntu4 is installed.
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     libc-dev-bin [Not Installed]                       
2)     libc6-dev [Not Installed]                          



Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Upgrade the following packages:                                     
1)     locales [2.13+git20120306-19 (now) -> 2.19-18+deb8u10 (oldstable)]

     Downgrade the following packages:                                   
2)     libc-bin [2.21-0ubuntu4 (now) -> 2.19-18+deb8u10 (oldstable)]     
3)     libc6 [2.21-0ubuntu4 (now) -> 2.19-18+deb8u10 (oldstable)]     

首先给出了1个方案:

1)     libc-dev-bin [Not Installed]                       
2)     libc6-dev [Not Installed]  

问我是否接受,我答n以后给了第二个方案

1)     locales [2.13+git20120306-19 (now) -> 2.19-18+deb8u10 (oldstable)]
     Downgrade the following packages:                                   
2)     libc-bin [2.21-0ubuntu4 (now) -> 2.19-18+deb8u10 (oldstable)]     
3)     libc6 [2.21-0ubuntu4 (now) -> 2.19-18+deb8u10 (oldstable)]

自动解决依赖问题!

用这个命令安装aptitude:

sudo apt install -y aptitude

有个别情况需要多试几种方案

posted @ 2018-08-18 23:03  asml  阅读(2749)  评论(0编辑  收藏  举报
@.@