Jan
3

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. :-h

This worked perfectly fine for me. If you experienced any errors, post a message and I will try to help you out ;)

Related Posts

37 Comments to “Howto: Install yum On RHEL 4”

  • A tip on how to install yum in RHEL 4 January 5, 2008 at 2:35 am

    [...] has a guide on installing YUM on RHEL4. She got the idea from a blog entry about installing yum in [...]

  • Nata February 12, 2008 at 5:05 am

    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.

  • Ryan September 3, 2008 at 2:01 am

    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

  • stovie September 17, 2008 at 6:40 am

    Thanks! I ran through your instructions and they worked perfectly on RHEL4.

  • nathan September 18, 2008 at 9:16 pm

    Thanks so much, worked great first time no problems!

  • iwahd September 24, 2008 at 2:06 pm

    Worked perfect on RHEL4.7. thanks :)

  • TASSEMBEDO Ismahil October 21, 2008 at 12:18 am

    This worked perfectly fine for me too.
    Thanks for your Howto!

  • bipper November 7, 2008 at 8:43 pm

    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.

  • dragonlair December 25, 2008 at 7:10 pm

    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.

  • rwb January 13, 2009 at 7:32 am

    When importing the GPG file, you will need to use a regular dash for the -install keyword.

    rpm –import RPM-GPG-KEY-CentOS-4

  • John March 7, 2009 at 2:36 am

    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?

  • Chad March 26, 2009 at 5:51 am
  • Lee May 21, 2009 at 10:51 am

    x

  • khalifah May 26, 2009 at 10:37 am

    hello there..

    I’m anew linux user…

    please teach me…

    i really appreciate that…

    khalifah´s last blog post is

  • Charles Westmoreland June 23, 2009 at 1:22 am

    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.

  • mahdi July 12, 2009 at 1:38 pm

    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

  • Mustafa Kamal September 18, 2009 at 1:13 am

    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 :D

    http://rapidshare.com/files/281407522/yum-2.0.8-1.noarch.rpm.html
    MD5: F14FC23B7CC27455A9CFD92650054539

  • fonji September 18, 2009 at 10:02 pm

    Thank you so very much.

  • Randil Wijerathne September 24, 2009 at 2:08 pm

    Thanks dude it works fine

  • Ted October 23, 2009 at 5:07 pm

    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

  • Simmi November 13, 2009 at 5:16 pm

    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:

  • Simmi November 13, 2009 at 5:18 pm

    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:

  • marc December 18, 2009 at 3:49 am

    Waaa ngsearch ako dito ako napunta. :D yun tapos ko na magamit dun ko lng nalaman yung url :D

  • Rai January 2, 2010 at 10:39 pm

    @Simmi

    Try another mirror. The one you are using is no longer working. :)

  • gjbmiller January 5, 2010 at 9:23 am

    Still works great. Thanks so much for the how to!

  • David Beecher January 31, 2010 at 1:02 pm

    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

  • Jerome April 28, 2010 at 3:05 pm

    Thanks a lot! It works well!
    YUM run well on RHEL4.

  • Local Repositories May 6, 2010 at 1:15 pm

    [...] To configure the YUM repository for RHEL3 and RHEL4 http://www.pinoytux.com/linux/howto-…-yum-on-rhel-4 If you have problem with proxy server for resolving with Domain controller use the following [...]

  • Akethbec July 6, 2010 at 2:00 am

    Thank you so much!!!.

    Just Before install yum, you can download the “previous” rpm from here: http://dag.wieers.com/rpm/packages.php and if your RedHat is 64 bits, edit the lines in step 3 (delete i386 and write x86_64)

    Regards!

  • Eric Gillette July 14, 2010 at 8:28 am

    I wonder though. . .does this interfere with up2date at all, or do they work in unison??

  • i am not able to install flash player in redhat 4.5 64 bit WS October 20, 2010 at 1:00 pm

    [...] hope thi link helps you more http://www.pinoytux.com/linux/howto-…-yum-on-rhel-4 you can also try [...]

  • Michael Butler May 25, 2011 at 3:16 am

    Thank you! You helped me install Mplayer on a RHEL 4 Server!

  • Toobers June 16, 2011 at 8:09 am

    So, all of this went very well until I tried a mass update.. Updating a few RPMs works fine, however I have a server with 6 repos (various deployments) and continue to get this error…

    –> Running transaction check
    –> Processing Dependency: gstreamer-tools for package: gstreamer-plugins
    –> Processing Dependency: openldap = 2.2.13-12.el4_8.3 for package: compat-openldap
    –> Processing Dependency: openldap = 2.2.13-6.4E for package: compat-openldap
    Traceback (most recent call last):
    File “/usr/bin/yum”, line 29, in ?
    yummain.main(sys.argv[1:])
    File “/usr/share/yum-cli/yummain.py”, line 138, in main
    (result, resultmsgs) = base.buildTransaction()
    File “__init__.py”, line 401, in buildTransaction
    File “depsolve.py”, line 226, in resolveDeps
    File “depsolve.py”, line 357, in _processReq
    File “depsolve.py”, line 418, in _requiringFromInstalled
    File “__init__.py”, line 1479, in getInstalledPackageObject
    IndexError: list index out of range

    Is there some kernel tuning that needs doing or some parameter I need to set for python?

  • Joe Schmoe March 9, 2012 at 1:51 pm

    Awesome – all works! downloading updates to all my RPMs thanks to you

  • Sandesh June 20, 2012 at 6:26 pm

    Hi,

    I had not Configured /etc/yum.conf to use compatible repository. Bit it downloading updates after hitting “yum update” command. Is it OK.

    Regards,
    Sandesh

  • Falko April 29, 2013 at 5:29 pm

    I have also the problem, that # yum update is not going:

    # yum update
    Gathering header information file(s) from server(s)
    Server: CentOS-3AS Base
    retrygrab() failed for:
    http://mirror.centos.org/centos/4/os/i386/headers/header.info
    Executing failover method
    failover: out of servers to try
    Error getting file http://mirror.centos.org/centos/4/os/i386/headers/header.info
    [Errno 4] IOError: HTTP Error 404: Not Found

    Where can i find a valid mirror und what i have to do with /etc/yum.conf then?

    Regards Falko

  • 博文:《RHEL4 安装yum》 - 苗乡小鱼的博客 June 11, 2013 at 2:03 am

    [...] 4. 安装CentOS的GPG Key# rpm –import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-45. 测试yum是否正常(下面是更新所有的rpm)# yum update*注意: 此方式更新所有已经安装的rpm,你不需要则可以取消如果进行到第五步没有错误,那就基本正常了!参考原文(英文):Howto: Install yum On RHEL 4Tags – linux , redhat , yum [...]

Post comment

CommentLuv Enabled

Powered by 1and1.comDomain Registrations starting at $9.98* Earn with Your BlogAdvertise @ PinoyTux

Search PinoyTux

Subscribe to Email Feeds

Enter Email Address:

Blog Lounge

Popular Posts

Recent Posts

Recent Comments

Site Stats