Tuesday, July 27, 2010

Update Older RHEL with YUM

I had a running version RHEL 3 WS that had not been updated in a while (more than a year). I found out that it was no longer getting updates from Redhat because the update contract was not renewed. I needed more current software on it to perform software testing. I like to do my updates with YUM which was not available on Redhat EL3, but here is how I got the updates I needed using YUM.
The first problem I encountered was that there is no public repository to update RHEL machines i.e you have to pay for it. I have used CentOS and know that CentOS offers public repositories and they work with RHEL as well. After struggling for some time, I discovered that I was accessing older version of repos through the latest yum, that was not working. I had to use an older version of yum with RHEL 3, since old repos do not support xml based updating.

Now I have a fully updated system. Here is how I did it.

1) Since I needed a older version of YUM I had to looked all over the web for the needed version, once I found it I saved it so you could find it more easily.

2) Download yum-2.0.8-1.noarch.rpm (for RHEL 3) from
http://dl.dropbox.com/u/7936116/yum-2.0.8-1.noarch.rpm

3) Install it using
rpm –i yum-2.0.8-1.noarch.rpm

4) Configure your yum.conf to look like this:

[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/3/os/i386/
gpgcheck=1

[updates]
name=Red Hat Linux $releasever – Updates
baseurl=http://mirror.centos.org/centos/3/updates/i386/
gpgcheck=1

5) Download the gpg key for CentOS rpm packages from
http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-3
6) Import the key like this:
rpm –import RPM-GPG-KEY-CentOS-3

7) Run “yum update”.

You can change the 3 in the conf files to what ever version of RHEL you are using.

Enjoy!

1 comment:

Anonymous said...

wow thanks m8 great job, i let my redhat fall behind with updates and subscription, now fully updating, life saver.