Installing Yum on CentOS 4

I’m officially on mediatemple now and after getting my VPS or (dv) cleansed of plesk I noticed Yum was not installed. I’m planning on doing a full writeup after a few days but for now I’ll get this tutorial on how to install Yum on CentOS 4 out of the way.
First off you’ll need to install a key from the centos mirrors,

# rpm –import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4

Next let’s start installing yum,

# rpm -Uvh http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/yum-2.4.3-3.el4.centos.noarch.rpm
Retrieving http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/yum-2.4.3-3.el4.centos.noarch.rpm
error: Failed dependencies:
libxml2-python is needed by yum-2.4.3-3.el4.centos.noarch
python-elementtree is needed by yum-2.4.3-3.el4.centos.noarch
python-sqlite is needed by yum-2.4.3-3.el4.centos.noarch
rpm-python is needed by yum-2.4.3-3.el4.centos.noarch
urlgrabber is needed by yum-2.4.3-3.el4.centos.noarch

As you can tell there are a few dependencies that need to be installed first. If you’re going to copy and paste these commands be careful,

# rpm -Uvh http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/libxml2-2.6.16-10.i386.rpm
# rpm -Uvh http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/libxml2-python-2.6.16-10.i386.rpm
# rpm -Uvh http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/python-elementtree-1.2.6-5.el4.centos.i386.rpm
# rpm -Uvh http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm
# rpm -Uvh http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/python-sqlite-1.1.7-1.2.1.i386.rpm
# rpm -Uvh http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/rpm-python-4.3.3-22_nonptl.i386.rpm
# rpm -Uvh http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/python-urlgrabber-2.9.8-2.noarch.rpm

Wow that was a lot, now finally yum,

# rpm -Uvh http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/yum-2.4.3-3.el4.centos.noarch.rpm

And you should now have yum installed and ready to run. I won’t tell you how to use yum but the first thing I did was run,

# yum update

About the Author, Dan Cameron:

I'm the owner and solution engineer at Sprout Venture, a web solutions company that specializes in web development including WordPress.

I started my first blog in 2003 and transitioned to WordPress in 2004. Since moving to WordPress I've written a few plugins and themes for public consumption. Lately I'm busy engineering/building/coding and have only been able to share a few code snippets.

If you're in need of some web development, web design or custom WordPress plugins and/or themes contact me, I'll be happy to discuss it with you.

Read More »

  • Thanks a bunch! I appreciate this. Was looking all over, as I am trying to install dkim, and needed the patch command... which was only available though yum!

    # yum install patch

    Thanks again!
  • Arash
    I really Kiss You :X
  • Hi all, this tutorial works great. I just thought I would let everyone know that since this article was posted there have been some updates to the links for several of the commands... You may want to go to this address: http://mirror.centos.org/centos/4/os/i386/CentO... and do a control > find to search for the exact version of the file you will need. Some of the links above are out of date.

    Thanks for the tutorial,
    Wes
  • Thanks for this tutorial - I had the same problem and working from your commands here I was able to get yum running (eventually).

    Now to get JSON support in PHP5... :)

    Cheers,

    Beau
  • Just moved to mediatemple myself, tried plesk, had it removed, and was facing the same problem. Very helpful article thank you.
  • Anonymous
    Your guide worked perfect for me and now I am up to date. Thanks!
  • Guoping Huang
    I have a major problem isntalling yum on spry.com's vps. I followed your instructions and here's what I got:

    rpm -Uvh http://mirror.centos.org/centos/4/os/i386/CentO...
    Retrieving http://mirror.centos.org/centos/4/os/i386/CentO...
    error: Failed dependencies:
    rpm = 4.3.3-22_nonptl is needed by rpm-python-4.3.3-22_nonptl.i386

    rpm -Uvh http://mirror.centos.org/centos/4/os/i386/CentO...
    Retrieving http://mirror.centos.org/centos/4/os/i386/CentO...
    error: Failed dependencies:
    yumconf is needed by yum-2.4.3-3.el4.centos.noarch

    Any clue? I would really appreciate it.
  • Johnny
    yumconf can be found here

    http://rpm.pbone.net/index.php3/stat/4/idpl/346...

    and provides:

    [root@home root]# rpm -ql centos-yumconf-4-4.5
    /etc/yum.repos.d/CentOS-Base.repo
  • Would install yum tonight, think it should not be a major problem
blog comments powered by Disqus