Install yum on your vmware vma

DANGER!! Please note this will likely null and void any kind of warranty or support you may have on your vma, and it will also break vima-update depending on what you allow yum yo update, it might even cause the world to explode.. I dont know and Im not responsible for anything that goes wrong following this..

With that out of the way.. So you want to install yum on your vma so you can install some packages on your vma, and you dont want to track down rpms for it.. I had the same desire. Here is how I took care of the problem.. First I found that /etc/redhat-release stated I was using a Red Hat Enterprise Linux Server release 5.2 (Tikanga). Once I found this out I decided to use CentOS mirrors to get me a copy of yum and to update rpm and such so I could have yum.

First the base vma is missing some stuff in order to just grab yum and start using it. I found mine to be missing python-initparse, yum-fastestmirror, and yum-metadata-parser. For me I got a root shell using sudo -s, next I ran the following command from my root shell:
# rpm -Uvh http://mirror.centos.org/centos/5/os/x86_64/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm http://mirror.centos.org/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm http://mirror.centos.org/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm

This installed yum and the missing libs I needed to use it. Next I had to create a yum.conf repo file that the system can use to pull packages from. I used the following:

[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
bugtracker_url=http://bugs.centos.org/yum5bug

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

installonly_limit = 5

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

[base]
name=CentOS-5.2 - Base
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
protect=1

#released updates
[update]
name=CentOS-5.2 - Updates
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
protect=1

Please note the repo info like the file states can be added to a .repo file if you want, but to shorten this for me Im doing it all in 1 place. I would also suggest going though and adding things like kernel* to the excludes= section (that is really beyond what Im trying to cover here though). Once you have this minimal info in your file you can save it. Next you need to import the RPM-GPG-KEY so you can install files.. As root:

rpm --import http://mirror.centos.org/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5

Now you can update things like rpm, or even install vim-common or emacs :) You could also go a step further and install the epel repo and then install puppet so if you are in a large scale environment you can keep the system updated and files in sync with all your other hosts.

3 thoughts on “Install yum on your vmware vma”

  1. again, please note this will break vima-update processes depending on what you allow yum to update.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>