ubuntu18.04解决apt --fixed-broken install

本人是一个计算机小白,最近在使用apt胡乱安装一些东西导致apt无法继续使用了,每次使用apt install * / apt remove * / apt upgrade等系列命令时总会报相同的类似于以下的错误

You might want to run 'apt --fix-broken install' to correct these.

The following packages have unmet dependencies:

mlnx-ofed-kernel: Depends: ibutils2 ( >= 2.0.1.5 - 3ubuntu1 )but it is not going to be installed.

看到提示,首先会尝试使用他推荐的方法,执行命令

apt --fix-broken install

当然,如果这个命令有作用的话,那也就很简单了,使用这个命令之后依然无效。

通过查询网上的解决办法,我尝试了很多次无果,后来索性想到直接把这个东西全部删掉

sudo su
cd /
find -name mlnx-*

通过find命令可以看到在系统中有许多mlnx-*的文件,通过cd和rm -rf的命令依次将这些文件删除之后,运行apt的自动删除命令

apt autoremove

执行完之后发现apt已经可以正常使用了。
 

猜你喜欢

转载自blog.csdn.net/eternal963/article/details/129705533