问题描述
apt报错:E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)
。相关命令 apt install xxx
, apt upgrade
, apt remove xxx
, apt autoremove
等都会出现报错。
尝试过的方法:
apt --fix-broken install
apt install aptitude
- …
在尝试多种方法无果后,总结了这个方法,亲测有效
解决方案:
思路:使用 dpkg 移除有问题的包,跳过 apt 的依赖检查
- 查看有问题的包
两种方法,任选其一- 运行
dpkg --configure -a
,然后记录末尾的Errors were encountered while processing:
后的包名 - 运行
apt upgrade
,然后记录The following packages have unmet dependencies:
下的包名
- 运行
- 移除有问题的包
dpkg -r xxxx
测试一下:apt install apt --upgrade
,成功
PS: 我尝试把移除的包使用 apt 重新安装回来,结果重现了依赖问题。算了,反正不要也没事 (~ ̄▽ ̄)~