E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

搞坏了apt-get?循环依赖?不要怕,因为下面可以救你,方案来自:

https://cloud.tencent.com/developer/article/1492787

感谢作者

我的问题如下:

sudo apt-get --fix-broken install 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 aptitude : Depends: aptitude-common (= 0.8.10-6ubuntu1) but it is not installed
            Depends: libcwidget3v5 but it is not installed
 libatk1.0-0 : Depends: libatk1.0-data (>= 2.30.0-2) but 2.28.1-1 is installed
 libatk1.0-dev : Depends: libatk1.0-0 (= 2.28.1-1) but 2.30.0-2 is installed
 libcwidget3 : Depends: libsigc++-2.0-0c2a (>= 2.2.0) but it is not installable
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

不管是remove什么install什么都会出这个依赖问题,啥都卸不了啥都安不了,试了好多方法都没用,包括换源、dpkg configurate -a、更改各种conf文件,重置aptget、、aptget-f、google找解决方案都没有解决。
这时候可以使用强制卸载命令

sudo dpkg --force-depends --remove libatk1.0-0

反正上面啥玩意有依赖问题就卸载谁,全卸载就完了,我卸载了上面显示的四个,完事后用:

sudo apt-get install -f

进行修复即可,

注意:

我这样搞定了,但是此方法有风险,过程中我看到我的卸载了较多的系统软件,我的terminal快捷键都没了,但是aptget install -f之后就全回来了,担心的话在重启之前最好备份重要文件

最后就是重启了

你可能感兴趣的:(Linux)