8

好吧,我正在尝试执行以下命令。

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,但由于此错误而无法安装,你们中的任何人都知道我在做什么错吗?

谢谢 :)

4

2 回答 2

16

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

rpm -e --nodeps PACKAGE

在命令行中。

于 2013-04-04T15:24:55.987 回答
7

该命令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

于 2017-05-11T16:55:23.420 回答