Trying to remove yum which is protected in Centos
Solution 1
The right way to do what I was looking for is by doing:
rpm -e --nodeps PACKAGE
in the command line.
Solution 2
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
Uriel Hernández
Updated on March 04, 2021Comments
-
Uriel Hernández about 3 years
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 :)
-
Bren about 10 yearsThanks a lot, now yum does not work at all. It yum warns you this, apparently it means yum requires the lib you are trying to remove. So don't. Because it will break yum.
-
tschale over 9 yearsHad the same problem as @gomyes, but as I was updating a package (installing it via
rpm
afterwards),yum
worked again. So this should maybe only be used for updating a certain package, if for some reason you can't or won't update it viayum update
. -
McNab over 9 yearsI had the same problem, the comments in this answer put me off using this command. I got desperate though, it worked fine and yum wasn't affected. Centos 6.6.
rpm -e --nodeps libffi
and then I installed libffi-devel withyum install libffi-devel
. Ruby then installed fine. superuser.com/questions/841805/… -
Bal over 8 yearsThis broke yum for me after i removed openssl. To fix it, I had to manually download the openssl rpm and re-install it.
-
Ahmad Abdelghany about 7 yearsInstalling 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. access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/…