欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2022-06-25 20:44:53
...

总结一下怎么样解决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://*.com/questions/26571326/how-do-i-resolve-the-following-packages-have-unmet-dependencies

相关标签: lib ubuntu