尝试删除在Centos中受保护的yum

那么,我试图执行以下命令。

yum remove libffi-3.0.9-1.el5.rf.i386 

因为我需要该文件(?),但是在使用rvm安装ruby时遇到问题,因为libffi-devel是rvm安装ruby的依赖。

但是,它给了我下面的错误,当然它不会删除任何东西。

 Error: Trying to remove "yum", which is protected You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest 

我已经试过–skip-broken,我得到这个:

 Error: Trying to remove "yum", which is protected You could try running: rpm -Va --nofiles --nodigest 

正如你所看到的,我不是Linux的专家,但是我需要用rvm来安装Ruby,而且我不能因为这个错误,所以你们中的任何人都知道我在做什么错了?

谢谢 :)

做我正在寻找的正确方法是做:

 rpm -e --nodeps PACKAGE 

在命令行中。

命令:

 yum remove <package> 

将尝试删除包以及任何依赖它的包。

在你的情况下,你正在尝试删除一个包,而有很多其他的包依赖它,包括yum包本身。 这就好像你运行yum remove yum这就是为什么你得到这个错误信息。

命令:

 rpm -e --nodeps <package> 

可以用来删除一个包,而不需要删除依赖它的包, 但是这显然会打破所有这些包。

使用rpm –nodeps安装或删除软件包会导致应用程序运行异常和/或崩溃,并可能导致严重的软件包管理问题或系统故障。

有关详情,请参阅https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Removing.html