Uriel Hernández
Uriel Hernández

Reputation: 741

Trying to remove yum which is protected in Centos

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.

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:

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?

Thank you :)

Upvotes: 10

Views: 53092

Answers (2)

Ahmad Abdelghany
Ahmad Abdelghany

Reputation: 13248

The command yum remove <package> removes the package as well as any packages that depend on it.

In your case, you are trying to remove a package that has many other packages depending on it, including the yum package itself. It is as if you run yum remove yum, which is why you get this error message.

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.

For more details see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Removing.html

Upvotes: 10

Uriel Hern&#225;ndez
Uriel Hern&#225;ndez

Reputation: 741

The right way to do what I was looking for is by doing:

rpm -e --nodeps PACKAGE

in the command line.

Upvotes: 14

Related Questions