Q. By accident my yum command was deleted under Red Hat Enterprise Linux version 5.x. Now I'm not able to download and update system using RHN. How do I fix this issue without reinstalling RHEL again?
A. You can try any one of the following solutions to restore yum:
(a) Copy yum command (/usr/bin/yum) from other working system (same version and architecture) using ssh / scp command.
(b) Download yum rpm itself from RHN. First, log into RHN. Select the "Channels" tab then select the "Red Hat Enterprise Linux" channel for your system in the channel name table. You can search RPM and then select "Package" link. Once downloaded just run rpm command over yum command.
# rpm -ivh --force rpm*
(c) Download yum source rpm from public Red Hat ftp server and rebuild yum rpm:
# wget http://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/yum-3.0.1-5.el5.src.rpm
# rpm -ivh yum-3.0.1-5.el5.src.rpm
# cd /usr/src/redhat/SPECS
# rpmbuild -bb yum.spec
# rpm -ivh --force /usr/src/redhat/RPMS/noarch/yum-3.0.1-5.noarch.rpm
# yum --version
(d) Grab yum rpm from one of the CentOS mirror and just install it.
(e) Copy yum binary from your backup tape device.
(f) Copy yum RPM from updated media CD / DVD and install the same using rpm command.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 4 comments… read them below or add one }
is it possible install yum on red hat enterprise linux 4 with this methode?
thx
no, it is not recommended to mix up2date with yum. This is RHEL5/CentOS 5 specific issue
Very helpful, thank you!
I used method (c) on my CentOS 5 :D
Thank you for the tutorial.
Yum was broken on a VM someone else created a few years back and I’ve been trying to figure out how to fix it. Reinstalling didn’t ‘fix’ the problem, but did let me work around it.
This is exactly what I was looking for:
# wget http://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/yum-3.0.1-5.el5.src.rpm
# rpm -ivh yum-3.0.1-5.el5.src.rpm
# cd /usr/src/redhat/SPECS
# rpmbuild -bb yum.spec
# rpm -ivh –force /usr/src/redhat/RPMS/noarch/yum-3.0.1-5.noarch.rpm
Thanks again.