Installing yum on CentOS 5.3
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
vim yumdownload
#!/bin/bash
for file in \
elfutils-0.137-3.el5.i386.rpm \
elfutils-libs-0.137-3.el5.i386.rpm \
elfutils-libelf-0.137-3.el5.i386.rpm \
expat-1.95.8-8.2.1.i386.rpm \
gmp-4.1.4-10.el5.i386.rpm \
libxml2-2.6.26-2.1.2.7.i386.rpm \
libxml2-python-2.6.26-2.1.2.7.i386.rpm \
m2crypto-0.16-6.el5.3.i386.rpm \
python-2.4.3-24.el5.i386.rpm \
python-elementtree-1.2.6-5.i386.rpm \
python-iniparse-0.2.3-4.el5.noarch.rpm \
python-sqlite-1.1.7-1.2.1.i386.rpm \
python-urlgrabber-3.1.0-5.el5.noarch.rpm \
readline-5.1-1.1.i386.rpm \
rpm-4.4.2.3-9.el5.i386.rpm \
rpm-libs-4.4.2.3-9.el5.i386.rpm \
rpm-python-4.4.2.3-9.el5.i386.rpm \
sqlite-3.3.6-2.i386.rpm \
yum-3.2.19-18.el5.centos.noarch.rpm \
yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm \
yum-metadata-parser-1.1.2-2.el5.i386.rpm
do wget http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/$file;
done
chmod a+x yumdownload
./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.
Tags: yum centos tip linux




May 21st, 2009 at 18:41
[...] http://upstream-berlin.com/2009/04/30/installing-yum-on-centos-53/ [...]
May 21st, 2009 at 20:28
Thanks m8, very helpful!
June 13th, 2009 at 20:56
just wanted to say this was the only tutorial that helped me install yum after uninstalling it due to my mirror file getting messed up. Thanks very very very much
July 6th, 2009 at 17:53
Hey thankyou.
Atlast, I Installed YUM & Updated it on my CentOS 5.3 machine
July 11th, 2009 at 23:52
Hey all i get this can someone tell me what is wrong?
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
No module named sqlite
Please install a package which provides this module, or
verify that the module is installed correctly.
It’s possible that the above module doesn’t match the
current version of Python, which is:
2.4.3 (#1, Jan 21 2009, 01:10:13)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq
August 8th, 2009 at 06:56
Thanks! This helped get yum working again. For x64_64, change the second to last line to the following:
do wget http://mirror.centos.org/centos-5/5.3/os/x86_64/CentOS/$file;
August 9th, 2009 at 03:29
Seems some so files need to be installed as well for this.And all i386files need to be replaced with x86_64 for 64 bit version.
September 22nd, 2009 at 17:42
thx for youhelp. i want to foward it and sigh this url. thanks very much.:)
September 25th, 2009 at 13:07
After messing up my vps – I had to reinstall yum and being a rather newbie at linux your tutorial helped me out greatly. Thank you so much!
November 10th, 2009 at 12:46
Thanks for the info
November 28th, 2009 at 23:21
Thanks so much – you’re a legend!
December 8th, 2009 at 16:39
I also had this issue setting up a VS at my day job. This tutorial was very helpful, thanks!
It’s worth noting, that if yum was not installed, your server is not running an official CentOS distribution, and according to the official CentOS line, you have been lied to and misled by your host. It’s worth contacting your host for more detail as to why they are providing a non-CentOS distribution and still calling it CentOS. See http://wiki.centos.org/TipsAndTricks/BrokenVserver for more detail.
I am in the process of querying this exact issue with our host.
I’m by no means a Linux or sysadmin expert or CentOS purist, but I believe this is important, because you will find you have less community support on things like the CentOS forums and IRC channel when it’s discovered that your distribution is something that is considered non-CentOS.
I have VS hosting running CentOS elsewhere without these problems, and I would recommend you change hosts if you don’t get satisfactory answers from your current provider.
December 16th, 2009 at 18:20
[...] Installing yum on CentOS 5.3 | upstream agile – software [...]
March 7th, 2010 at 01:47
Hey I came across your webpage by chance on msn while trying to find something completely obscure but I am truly happy that I did, You have just captured yourself another subscriber.
March 8th, 2010 at 19:21
[...] Installing yum on CentOS 5.3 | upstream agile – software [...]
Thank you