Howto: Install yum On RHEL 4
There are more than a couple of ways of updating Red Hat Enterprise Linux (RHEL) packages on your machine. One is by using up2date, the default package updater of RHEL systems. Unlike Fedora and CentOS which uses yum, up2date requires you to be registered to Red Hat Network (RHN) to be able to download or update your packages from the RHN repository.
Now, what if you need to install a certain package that is not available in your current repository by up2date? Or what if the package in the repository wreaks havoc in your system? Maybe you should try using yum to install or update rpm packages.
But… but… but how can I install yum in my RHEL machine?, you may ask. It’s actually very simple.
I got this tip from Babar Haq’s Blog with a little modification since I am using RHEL 4.
1. Download yum by using wget
# wget http://linux.duke.edu/projects/yum/download/2.0/yum-2.0.8-1.noarch.rpm
2. Install the rpm
# rpm -ivh yum-2.0.8-1.noarch.rpm
3. Configure /etc/yum.conf to use compatible repository
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
[base]
name=CentOS-$releasever – Base
baseurl=http://mirror.centos.org/centos/4/os/i386/
gpgcheck=1
[updates]
name=Red Hat Linux $releasever – Updates
baseurl=http://mirror.centos.org/centos/4/updates/i386/
gpgcheck=1
4. Download and install the CentOS GPG Key
# wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4
# rpm –import RPM-GPG-KEY-CentOS-4
5. Test yum to see if it works (I tested by running full update on my machine)
# yum update
*Note: This will update ALL installed packages in your machine. If you do not want to do this, cancel the process or skip this step.
If you reach step 5 without encountering any errors, it means that yum is successfully updating your machine with the latest versions available in the repo. ![]()
This worked perfectly fine for me. If you experienced any errors, post a message and I will try to help you out ![]()
Related Posts
26 Comments to “Howto: Install yum On RHEL 4”
Post comment
Search PinoyTux
Subscribe to Email Feeds
Blog Lounge
Popular Posts
Recent Posts
Drop your Card Here
Recent Comments
- baby
on My October Earnings from Adbrite - ramakanth
on My October Earnings from Adbrite - juan kara-an
on Cebu Pacific Airlines is Evil! - Eugene Engelbrecht
on Cebu Pacific Airlines is Evil! - David Beecher
on Howto: Install yum On RHEL 4









[...] has a guide on installing YUM on RHEL4. She got the idea from a blog entry about installing yum in [...]
If it worked in 2006, it doesn’t in 2008.
Options, paths to release repositories changed and the commands have to be modified.
I’m using rhel 4.2 on VmWare since I can’t get a lab machine from my admin to upgrade to rhel 5.0, which is required for evaluating new packages. I installed yum2.0.8 but it does not see the new package repo using yum list.
Thanks for the guide. I was having trouble finding a good updated guide to installing YUM on RHEL4. This worked perfectly for me the first time.
Good work.
Ryan’s last blog post is New Update To An Old Plugin
Thanks! I ran through your instructions and they worked perfectly on RHEL4.
Thanks so much, worked great first time no problems!
Worked perfect on RHEL4.7. thanks
This worked perfectly fine for me too.
Thanks for your Howto!
http://yum.baseurl.org/download/2.0/yum-2.0.8.tar.gz
I did wget http://yum.baseurl.org/download/2.0/yum-2.0.8.tar.gz instead. It seems the non archived files were removed, killing your link.
thanks for the trick.
its super. 
for bipper in #8, you can use the yum rpm and the dependencies in http://www.freevps.com/download/yum/RHEL4/
it works for me.
When importing the GPG file, you will need to use a regular dash for the
-installkeyword.rpm –import RPM-GPG-KEY-CentOS-4
Thank you for writing and posting this procedure.
After going through these steps and running yum update,
I get a message of no repositories available.
Do I need to set up a repository? And how do I do that?
The yum package can be found here (wget) http://gd.tuwien.ac.at/opsys/linux/yum/2.0/yum-2.0.8-1.noarch.rpm
x
hello there..
I’m anew linux user…
please teach me…
i really appreciate that…
khalifah´s last blog post is
Very helpful info. Thank you. I did, however, have to install 4 additional packages besides yum. Here they are in the order that I installed them:
python-elementtree-1.2.6-5.el4.centos.i386.rpm
python-urlgrabber-2.9.8-2.noarch.rpm
sqlite-3.3.6-2.i386.rpm
python-sqlite-1.1.7-1.2.1.i386.rpm
yum-2.4.3-4.el4.centos.noarch.rpm
Thanks again.
5. Test yum to see if it works (I tested by running full update on my machine)
#cat /etc/redhat-release
Enterprise Linux Enterprise Linux AS release 4 (October Update 7)
#yum update
Repository base is listed more than once in the configuration
Setting up Update Process
Setting up repositories
Cannot find a valid baseurl for repo: update
Error: Cannot find a valid baseurl for repo: update
Thanks, it worked flawlessly
I would like to point out that I had to use this package yum-2.0.8-1.noarch.rpm As it does not ask for dependencies newer versions of yum.
http://gd.tuwien.ac.at/opsys/linux/yum/2.0/yum-2.0.8-1.noarch.rpm
I have uploaded it to rapidshare.com for backup link
http://rapidshare.com/files/281407522/yum-2.0.8-1.noarch.rpm.html
MD5: F14FC23B7CC27455A9CFD92650054539
Thank you so very much.
Thanks dude it works fine
Works!
………but “# yum update” is dangerous coz it even changed my distro from RedHat to CentOs (i.e. CentOS login ,CentOs Desktop..). I have some software that only runs on redhat wouldnt run on the CentOS
Hi Rai
I tried everything as mentioned by you to install YUM .I got no error messages upto step No5 but after that on giving command
# yum update
got the following message…please help what to do next
100%[====================================>] 1,795 –.–K/s
14:24:22 (1.40 MB/s) – `RPM-GPG-KEY-CentOS-4′ saved [1,795/1,795]
[root@115 ~]# rpm -import RPM-GPG-KEY-CentOS-4
[root@115 ~]# yum update
Gathering header information file(s) from server(s)
Server: Red Hat Linux 4ES – i386 – Base
retrygrab() failed for:
http://mirror.dulug.duke.edu/pub/yum-repository/redhat/4ES/i386/headers/header.info
Executing failover method
failover: out of servers to try
Error getting file http://mirror.dulug.duke.edu/pub/yum-repository/redhat/4ES/i386/headers/header.info
[Errno 4] IOError:
Hi Rai
I tried everything as mentioned by you to install YUM .I got no error messages upto step No5 but after that on giving command
# yum update
got the following message…please help what to do next
100%[====================================>] 1,795 –.–K/s
14:24:22 (1.40 MB/s) – `RPM-GPG-KEY-CentOS-4′ saved [1,795/1,795]
[root@115 ~]# rpm -import RPM-GPG-KEY-CentOS-4
[root@115 ~]# yum update
Gathering header information file(s) from server(s)
Server: Red Hat Linux 4ES – i386 – Base
retrygrab() failed for:
http://mirror.dulug.duke.edu/pub/yum-repository/redhat/4ES/i386/headers/header.info
Executing failover method
failover: out of servers to try
Error getting file http://mirror.dulug.duke.edu/pub/yum-repository/redhat/4ES/i386/headers/header.info
[Errno 4] IOError:
Waaa ngsearch ako dito ako napunta.
yun tapos ko na magamit dun ko lng nalaman yung url 
@Simmi
Try another mirror. The one you are using is no longer working.
Still works great. Thanks so much for the how to!
Ditto! Thankyou so much. Converted a RHEL4 UP2DATE to YUM and using your HOWTO with DAG’s RPM repository worked like a dream. Thanks!
David