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 @   asml  阅读(2815)  评论(0编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
@.@
点击右上角即可分享
微信分享提示