CentOS: Install Yum


1. Login to your container/VPS via ssh as the root user.
2. Determine which version of CentOS you are running.
cat /etc/redhat-release

The output will be either:
CentOS release 6.2 (Final)
or:
CentOS release 5.7 (Final)
or:
CentOS release 5.6 (Final)
or:
CentOS release 5.5 (Final)


3. Paste the commands for your CentOS version to your command line.

CentOS 6.2:
rpm -Uvh --nodeps http://mirror.ihug.co.nz/centos/6/os/$(uname -i)/Packages/yum-metadata-parser-1.1.2-16.el6.$(uname -i).rpm http://mirror.ihug.co.nz/centos/6/os/$(uname -i)/Packages/yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm

rpm -Uvh http://mirror.ihug.co.nz/centos/6/os/$(uname -i)/Packages/gpgme-1.1.8-3.el6.$(uname -i).rpm http://mirror.ihug.co.nz/centos/6/os/$(uname -i)/Packages/pygpgme-0.1-18.20090824bzr68.el6.$(uname -i).rpm http://mirror.ihug.co.nz/centos/6/os/$(uname -i)/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm http://mirror.ihug.co.nz/centos/6/os/$(uname -i)/Packages/python-urlgrabber-3.9.1-8.el6.noarch.rpm http://mirror.ihug.co.nz/centos/6/os/$(uname -i)/Packages/python-pycurl-7.19.0-8.el6.$(uname -i).rpm http://mirror.ihug.co.nz/centos/6/os/$(uname -i)/Packages/rpm-python-4.8.0-19.el6.$(uname -i).rpm http://mirror.ihug.co.nz/centos/6/os/$(uname -i)/Packages/yum-3.2.29-22.el6.centos.noarch.rpm

CentOS 5.7:
rpm -Uvh --nodeps http://vault.centos.org/5.7/os/$(uname -i)/CentOS/yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm http://vault.centos.org/5.7/os/$(uname -i)/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.$(uname -i).rpm

rpm -Uvh http://vault.centos.org/5.7/os/$(uname -i)/CentOS/libxml2-2.6.26-2.1.12.$(uname -i).rpm http://vault.centos.org/5.7/os/$(uname -i)/CentOS/m2crypto-0.16-8.el5.$(uname -i).rpm http://vault.centos.org/5.7/os/$(uname -i)/CentOS/python-elementtree-1.2.6-5.$(uname -i).rpm http://vault.centos.org/5.7/os/$(uname -i)/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm http://vault.centos.org/5.7/os/$(uname -i)/CentOS/python-sqlite-1.1.7-1.2.1.$(uname -i).rpm http://vault.centos.org/5.7/os/$(uname -i)/CentOS/python-urlgrabber-3.1.0-6.el5.noarch.rpm http://vault.centos.org/5.7/updates/$(uname -i)/RPMS/rpm-python-4.4.2.3-22.el5_7.2.$(uname -i).rpm http://vault.centos.org/5.7/os/$(uname -i)/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm

CentOS 5.6:
rpm -Uvh --nodeps http://vault.centos.org/5.6/os/$(uname -i)/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm http://vault.centos.org/5.6/os/$(uname -i)/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.$(uname -i).rpm

rpm -Uvh http://vault.centos.org/5.6/os/$(uname -i)/CentOS/libxml2-2.6.26-2.1.2.8.el5_5.1.$(uname -i).rpm http://vault.centos.org/5.6/os/$(uname -i)/CentOS/python-elementtree-1.2.6-5.$(uname -i).rpm http://vault.centos.org/5.6/os/$(uname -i)/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm http://vault.centos.org/5.6/os/$(uname -i)/CentOS/python-sqlite-1.1.7-1.2.1.$(uname -i).rpm http://vault.centos.org/5.6/os/$(uname -i)/CentOS/rpm-python-4.4.2.3-22.el5.$(uname -i).rpm http://vault.centos.org/5.6/os/$(uname -i)/CentOS/m2crypto-0.16-6.el5.8.$(uname -i).rpm http://vault.centos.org/5.6/os/$(uname -i)/CentOS/python-urlgrabber-3.1.0-6.el5.noarch.rpm http://vault.centos.org/5.6/os/$(uname -i)/CentOS/yum-3.2.22-33.el5.centos.noarch.rpm

CentOS 5.5:
rpm -Uvh --nodeps http://vault.centos.org/5.5/os/$(uname -i)/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm http://vault.centos.org/5.5/os/$(uname -i)/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.$(uname -i).rpm

rpm -Uvh http://vault.centos.org/5.5/updates/$(uname -i)/RPMS/libxml2-2.6.26-2.1.2.8.el5_5.1.$(uname -i).rpm http://vault.centos.org/5.5/os/$(uname -i)/CentOS/m2crypto-0.16-6.el5.6.$(uname -i).rpm http://vault.centos.org/5.5/os/$(uname -i)/CentOS/python-elementtree-1.2.6-5.$(uname -i).rpm http://vault.centos.org/5.5/os/$(uname -i)/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm http://vault.centos.org/5.5/os/$(uname -i)/CentOS/python-sqlite-1.1.7-1.2.1.$(uname -i).rpm http://vault.centos.org/5.5/os/$(uname -i)/CentOS/python-urlgrabber-3.1.0-5.el5.noarch.rpm http://vault.centos.org/5.5/updates/$(uname -i)/RPMS/rpm-python-4.4.2.3-20.el5_5.1.$(uname -i).rpm http://vault.centos.org/5.5/os/$(uname -i)/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm


0 $type={blogger}: