1. For convenience, switch to the root user first
2. Delete the yum that comes with rhel6 first.
Rpm-AQ | grep Yum | xargs rpm-e -- nodeps
3. Download centos6 yum
wget http://mirrors.163.com/centos/6.0/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm wget http://mirrors.163.com/centos/6.0/os/x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm wget http://mirrors.163.com/centos/6.0/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6.0/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
4. install these RPM packages. You may have dependency problems during installation. Just try them several times.
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpmrpm -ivh yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpmrpm -ivh yum-3.2.27-14.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
5. Download The centos repo source configuration file. I downloaded the centos5 configuration. You must make some modifications to use it on centos6. I have already changed the source image. I use 163 of the source images in China.
[base]name=CentOS-6 - Baserepo=osbaseurl=http://mirrors.163.com/centos/6/os/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#released updates[update]name=CentOS-6 - Updatesbaseurl=http://mirrors.163.com/centos/6/updates/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#packages used/produced in the build but not released#[addons]#name=CentOS-6 - Addons#baseurl=http://mirrors.163.com/centos/5/addons/$basearch/#gpgcheck=1#gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#additional packages that may be useful[extras]name=CentOS-6 - Extrasbaseurl=http://mirrors.163.com/centos/6/extras/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages[centosplus]name=CentOS-6 - Plusbaseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/gpgcheck=1enabled=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users[contrib]name=CentOS-6 - Contribbaseurl=http://mirrors.163.com/centos/6/contrib/$basearch/gpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
6. Then put the CentOS-Base.repo under the/etc/yum. Repos. d/directory.
mv ./CentOS-Base.rep /etc/yum.repos.d/
7. Clear Yum Cache
yum clean all
8. It should be ready for use now.
Try: Yum search nginx