delete yum accidentally

General support questions
Post Reply
sumits7y
Posts: 1
Joined: 2019/07/29 14:21:41

delete yum accidentally

Post by sumits7y » 2019/07/29 14:27:24

I was trying to uninstall python2.7 but accidentally uninstalled yum to reinstall yum I downloaded yum rpm package but not able to install it
when I install I get
package yum-3.4.3-161.el7.centos.noarch is already installed
and when i run any yum command i get
bash: yum: command not found...

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: delete yum accidentally

Post by TrevorH » 2019/07/29 14:58:59

You can't "accidentally" remove yum. If you run yum remove yum it will tell you to go away. If you use rpm -e then it will tell you that it can't because there are dependencies. The only way to do it is to use rpm -e --force or --nodeps and at that point it's akin to buying a shotgun and pointing it at your own foot.

You can try rpm --reinstall /path/to/yum-3.4.3-161.el7.centos.noarch and see if that works.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply