April 30, 2009 by thilo
We recently deployed an app on a VM with CentOS 5.3. To our delight, the packet manager yum wasn’t pre-installed. We spent some time to get it running. The Howto on http://eric.lubow.org/2008/misc/adding-yum-to-centos-5/ was a great help, but it was for CentOS 5.2. So this is an update to Eric’s blogpost.
You need to have rpm and wget already installed. Create a temporary directory, paste the following code in a file in that directory, make it executable and run it:
mkdir temp && cd temp
for file in \
do wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/$file;
chmod a+x yumdownload
This will get you all rpms you might need before be able to install yum.
Now try installing them all by typing:
rpm -Uvh *.rpm
This might not work, at least not for us. So try to install yum directly with
rpm -Uvh yum-3.2.19-18.el5.centos.noarch.rpm and let the errors guide you. When you run into a circular dependencies, install the rpm by ignoring the dependencies. eg.
rpm -Uvh --nodeps yum-fastestmirror*
This should finally allow you to install yum. Good Luck. ;)