Saturday, January 21, 2006

Installing Yum On RHEL 3

I had a RHEL 3 WS at my work place. It irritated me terribly as the machine was never updated and hence having very old versions of softwares. Therefore I decided to upgrade my RHEL WS 3 using yum.

From my work place, internet is only accessible through http proxy, that too with authentication. I tried using up2date by creating an account at redhat's site but it didn’t work( I thought you could update one machine using your redhat account).

The first problem I encountered was that there is no public repository to update RHEL machines i.e you have to pay for it. After googling for a while I discovered that CentOS offers public repositories and they work with RHEL 3 as well.

I downloaded latest yum rpm, installed it and configured it to use centOS repo. Every time I ran yum, it failed. It couldn’t find repomd.xml file in the CentOS repositories I provided in yum.conf.

After struggling for some time, I discovered that I was accessing older version of repos through the latest yum. Therefore 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. Following is the brief summary of the steps I took

1) Since I was behind a proxy I had to export environment variable http_proxy.

2) Downloaded yum-2.0.8-1.noarch.rpm from
http://linux.duke.edu/projects/yum/download/2.0/yum-2.0.8-1.noarch.rpm

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

4) Configured my 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]
#ame=Red Hat Linux $releasever - $basearch - Base
#aseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/$releasever/$basearch/
[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) Downloaded the gpg key for CentOS rpm packages from
http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-3

6) Imported the key like this:
rpm --import RPM-GPG-KEY-CentOS-3

7) Run “yum –y update”. Now Sit back and enjoy seeing your system being updated.

Enjoy!

20 Comments:

At 9:26 AM , Anonymous kayrules said...

Thanks for this great article.. its saved me alot of time..

 
At 5:38 PM , Anonymous Anonymous said...

Absolutely fantastic article! Got my yum working instantly with these instructions! Keep up the good work!

 
At 11:48 PM , Anonymous Seb said...

This works nicely, but it doesn't really give you an up-to-date system. "make" is still a buggy version and requires a newer version of glibc to update it.

 
At 7:29 PM , Anonymous barry said...

thank you, your my hero

 
At 2:45 AM , Blogger FJSOFT said...

Didnt work:

[jyl@fjsoftllc yum]# yum -y update
Gathering header information file(s) from server(s)
Server: Red Hat Linux 3ES - i386 - Base
retrygrab() failed for:
http://mirror.dulug.duke.edu/pub/yum-repository/redhat/3ES/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/3ES/i386/headers/header.info
[Errno 4] IOError: HTTP Error 404: Not Found

Is there a fail-over server?

 
At 2:51 AM , Anonymous Jibran Ilyas said...

Thanks man, you saved me a lot of time.

 
At 10:36 PM , Blogger Kuatrinnus said...

Thanks so much. I thought I am stuck with this old RHEL3

 
At 8:57 PM , Anonymous Chaand said...

Works like a Charm , Great Work Man.

 
At 1:22 PM , Blogger ajit said...

This worked for me. Thanks

 
At 9:29 PM , Anonymous PinoyTux Weblog said...

[...]I got this tip from Babar Haq’s Blog with a little[...]

 
At 12:45 PM , Blogger pluto said...

Thanks a lot. Getting updates for RHEL3 was a show stopper before. Thanks very much for the tip.

 
At 2:52 PM , Anonymous joe donner said...

Nice one!

Thanks very much - this helped me out a lot!

 
At 2:06 AM , Blogger Le Bolide said...

This article is the gift that keeps on giving.

 
At 12:27 PM , Blogger Christopher said...

This is great and the set up worked flawlessly. One question - what does 'yum -y update' actually do? I am watching the updates go by and /var filling up and wonder if all these are actually updates of current libraries/applications. I say that partially because I tried 'yum search "enter package here"' and it seemed to do the same as 'yum -y update'. I would like to selectively search and install packages.

 
At 3:49 AM , Blogger AEC said...

Thanks. Very useful.
Do you know if these updates are identical to those from rhn?

Step #2 & #3 need adjustments:
prompt> wget http://yum.baseurl.org/
download/2.0/yum-2.0.tar.gz
prompt> gunzip yum-2.0.tar.gz
prompt> tar xvf yum-2.0.tar
prompt> cd yum-2.0
prompt> ./configure
prompt> make
prompt> make install

continue w/ step 4.

 
At 4:07 PM , Anonymous Anonymous said...

Thank you so much :D

 
At 9:14 AM , Blogger Colin Corrigan said...

Wicked article on converting from using RHN to YUM. Saved me a lot of time and effort and money re-registering our server with RH.

Thanks
COlin

 
At 1:32 AM , Anonymous Anonymous said...

Nice work - thanks. This info is surprisingly hard to find so I was happy to find it. The first phase has gone very well and although I have not yet dared to execute the last part all indications are that it will go well.

 
At 7:55 PM , Anonymous Anonymous said...

Blogs are so informative where we get lots of information on any topic. Nice job keep it up!!

Dissertation

 
At 10:03 PM , Blogger Victor said...

Thank you,
the previous admin mucked the yum to overcustomized it ... now I able to recovere the OS back to the official RHEL3.

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home