Installing Yum on CentOS 4

August 21, 2007

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