Linux 试图删除在 Centos 中受保护的 yum
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15799047/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Trying to remove yum which is protected in Centos
提问by Uriel Hernández
Well, I'm trying to execute the following command.
好吧,我正在尝试执行以下命令。
yum remove libffi-3.0.9-1.el5.rf.i386
Because I need that file (?), however facing problems while installing ruby with rvm, as libffi-devel is a dependecy of rvm to install ruby.
因为我需要该文件(?),但是在使用 rvm 安装 ruby 时遇到问题,因为 libffi-devel 是 rvm 安装 ruby 的依赖项。
However it gives me the following error, and of course it doesn't delete anything.
但是它给了我以下错误,当然它不会删除任何东西。
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
I've already tried with --skip-broken and I get this:
我已经尝试过 --skip-broken 并且我得到了这个:
Error: Trying to remove "yum", which is protected
You could try running: rpm -Va --nofiles --nodigest
As you may see, I'm not an expert in Linux, but I need to install Ruby with rvm and I can't because of this error, does anyone of you have an idea of what am i doing wrong?
如您所见,我不是 Linux 专家,但我需要使用 rvm 安装 Ruby,但由于此错误而无法安装,你们中的任何人都知道我做错了什么吗?
Thank you :)
谢谢 :)
采纳答案by Uriel Hernández
The right way to do what I was looking for is by doing:
做我正在寻找的正确方法是这样做:
rpm -e --nodeps PACKAGE
in the command line.
在命令行中。
回答by Ahmad Abdelghany
The command:
命令:
yum remove <package>
Will try to remove the package as well as any packages that depend on it.
将尝试删除该包以及任何依赖它的包。
In your case, you are trying to remove a package while there are a lot of other packages that depend on it, including the yumpackage itself. It is as if you run yum remove yum, which is why you get this error message.
在您的情况下,您正在尝试删除一个包,而有很多其他包依赖它,包括yum包本身。就好像您运行 一样yum remove yum,这就是您收到此错误消息的原因。
The command:
命令:
rpm -e --nodeps <package>
Can be used to remove a package without removing the packages which depend on it but this will obviously break all these other packages.
可用于删除包而不删除依赖于它的包,但这显然会破坏所有其他包。
Installing or removing packages with rpm --nodeps can cause applications to misbehave and/or crash, and can cause serious package management problems or, possibly, system failure.
使用 rpm --nodeps 安装或删除软件包可能会导致应用程序行为异常和/或崩溃,并可能导致严重的软件包管理问题,或者可能导致系统故障。
For more details see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Removing.html

