Install yum from centos vault

I had to update an old release of CentOS-5.5 on an OpenVZ container where yum was not available.

The below script should automatically download and install the required rpms from "vault.centos.org".

# install_yum.sh
    &nbsp;   rpm-<br />    &nbsp;   python-elementtree-1.2.6-5.x86_64.rpm
    &nbsp;   python-iniparse-0.2.3-4.el5.noarch.rpm
    &nbsp;   python-sqlite-1.1.7-1.2.1.x86_64.rpm
    &nbsp;   rpm-python-
    &nbsp;   python-urlgrabber-3.1.0-5.el5.noarch.rpm
    &nbsp;   yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
    &nbsp;   yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
    &nbsp;   yum-3.2.22-26.el5.centos.noarch.rpm
for rpm in $rpms
rpm -Uvh --nodeps http://vault.centos.org/5.5/os/x86_64/CentOS/${rpm};

Replacing sysklogd with rsyslog

If you need to replace old sysklogd with recent rsyslog on centos, `rpm -e --nodeps sysklogd` is rather kludgy as yum will remove initscripts, upon which most of the system is dependent on. However, it is possible to install and remove via the yum shell in one go, which resolves the dependency issues.

# yum shell
> install rsyslog
> remove sysklogd
> run
> quit

Metadata file does not match checksum

If getting the error "Metadata file does not match checksum", try running `

# yum clean metadata

`yum clean all` should also resolve the issue if the metadata fails.