• 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
    

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

  • 相关阅读:
    IDEA 删除java类的3种提示
    IDEA类和方法注释模板设置(非常详细)
    IntelliJ IDEA 2019,从入门到疯狂,图文教程
    intellij idea 如何将普通项目转换为maven项目
    使用idea误点 Add as Ant Build File选项后
    idea使用"svn"到项目报错Error:Cannot run program "svn" (in directory "E:XXXXXX"):CreateProcess error=2,
    Alertmanager 部署配置
    Prometheus PromQL 简单用法
    Prometheus PromQL 基础
    Prometheus 自动发现
  • 原文地址:https://www.cnblogs.com/DragonStart/p/9499178.html
Copyright © 2020-2023  润新知