libA : Depends: libB but it is not going to be installed E: Unable to correct problems

本文详细阐述了如何在Ubuntu系统中处理因包依赖问题导致的安装失败,包括安装aptitude工具、库降级的具体步骤,并通过一个实例演示了libpcl-dev依赖libvtk6的解决方案。阅读本文将帮助你顺利解决这类常见问题。

总结一下怎么样解决Ubuntu下因为包的依赖项导致的问题

1.举个例子

The following packages have unmet dependencies:
libpcl-dev : Depends: libvtk6-dev but it is not going to be installed
             Depends: libvtk6-qt-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

而安装libvtk6-dev又依赖于别的包,一环套一环的.

2.解决方式

2.1.安装aptitude

sudo apt install aptitude

2.2库降级

sudo aptitude install <package-name>

终端会给出提示

Keep the following packages at their current version

选择n

The following actions will resolve these dependencies:

     Downgrade the following packages:
...

系统会降级一些包,问你是否接受,我们要的就是降级这些包
选择y

The following packages will be DOWNGRADED:
...
The following NEW packages will be installed:
...
0 packages upgraded, 37 newly installed, 8 downgraded, 0 to remove and 184 not upgraded.
Need to get 37.7 MB of archives. After unpacking 205 MB will be used.
Do you want to continue? [Y/n/?]

最后,给出移除包,降级包和内存空间的信息
选择y

具体的例子可以看我这篇文章,比较具体,可供参考
ubuntu16.04 重新安装pcl的问题 libpcl-dev : Depends: libvtk6-dev but it is not going to be installed

参考
https://stackoverflow.com/questions/26571326/how-do-i-resolve-the-following-packages-have-unmet-dependencies

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值