How do I tell yum not to remove itself?
6,679
You are trying to remove some essential packages which would break your system if removed:
python
:yum
is written in Python, so this package cannot be removed, or else you lose your package manager.binutils
:systemd
needs this package, and systemd is your init system, which is crucial to using CentOS 7.gawk
: A ton of things depend ongawk
, including bothyum
andsystemd
.
You cannot remove those critical system packages, so exclude python
, binutils
, and gawk
from your list of packages to remove.
Note that you are still trying to remove some useful packages like gettext
, sudo
, and wget
, which might not horribly break your system but could reduce usability.
Related videos on Youtube
Author by
Chloe
Updated on September 18, 2022Comments
-
Chloe over 1 year
When I run this command
$ sudo yum erase git make gcc g++ zlib1g-dev libssl-dev wget subversion file python apt-utils binfmt-support vim apt-file xz-utils sudo subversion zlib1g-dev gawk flex unzip bzip2 gettext build-essential libncurses5-dev libncursesw5-dev libssl-dev binutils cpp psmisc docbook-to-man gcc-multilib g++-multilib
I get this error:
Error: Trying to remove "systemd", which is protected Error: Trying to remove "yum", which is protected
But those aren't packages I gave. I tried
-t
to tolerate errors, and-x yum -x systemd
to specifically exclude those two, but it still gave the error.$ sudo yum -x yum -x systemd erase git make gcc ...
-
Chloe about 7 yearsIt still gave the error. Isn't there a way to tell it to ignore any packages that
yum
depends on? -
Deltik about 7 years@Chloe: Reload my answer. I forgot to address
systemd
's dependency onbinutils
. -
Chloe about 7 yearsIt still complains about both of them.
-
Ramhound about 7 yearsUpdate your question with the current command your using
-
Deltik about 7 years@Chloe: How about now?
-
Chloe about 7 yearsI just kept running it one package at a time (well maybe 3 at a time) until it worked. I really wanted a way for it to figure it out automatically. Yes, I should not remove
sudo
either. It's a Vagrant box so it's pretty disposable. I want to keep the virtual disk as small as possible. If I need one of those, I'll just re-install it. -
Martian almost 7 yearsperhaps you should use cloud images - just a search away: centos cloud vagrant. - cloud.centos.org/centos/7/vagrant/x86_64/images
-
Pierre.Vriens over 6 yearsi do not get it
-
Darren over 6 yearsCould you add some more detail such as what this does.