第一步:
到上面这个网站去下载如下RPM包
python-iniparse-0.3.1-2.1.el6.noarch.rpm
python-urlgrabber-3.9.1-11.el6.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
yum-3.2.29-81.el6.centos.noarch.rpm
下载完成之后,用rpm命令进行安装,如下:
rpm -ivh --force --nodeps python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh --force --nodeps yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh --force --nodeps yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
rpm -ivh --force --nodeps yum-3.2.29-81.el6.centos.noarch.rpm
rpm -ivh --force --nodeps python-urlgrabber-3.9.1-11.el6.noarch.rpm
cp /usr/bin/python /usr/bin/python2.6.6
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo #没有网可以直接下载,再去上传
[root@localhost yum.repos.d]# ls CentOS6-Base-163.repo
1 # CentOS-Base.repo 2 # 3 # The mirror system uses the connecting IP address of the client and the 4 # update status of each mirror to pick mirrors that are updated to and 5 # geographically close to the client. You should use this for CentOS updates 6 # unless you are manually picking other mirrors. 7 # 8 # If the mirrorlist= does not work for you, as a fall back you can try the 9 # remarked out baseurl= line instead. 10 # 11 # 12 13 [base] 14 name=CentOS-$releasever - Base - 163.com 15 baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/ 16 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os 17 gpgcheck=1 18 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 19 20 #released updates 21 [updates] 22 name=CentOS-$releasever - Updates - 163.com 23 baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/ 24 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates 25 gpgcheck=1 26 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 27 28 #additional packages that may be useful 29 [extras] 30 name=CentOS-$releasever - Extras - 163.com 31 baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/ 32 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras 33 gpgcheck=1 34 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 35 36 #additional packages that extend functionality of existing packages 37 [centosplus] 38 name=CentOS-$releasever - Plus - 163.com 39 baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/ 40 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus 41 gpgcheck=1 42 enabled=0 43 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 44 45 #contrib - packages by Centos Users 46 [contrib] 47 name=CentOS-$releasever - Contrib - 163.com 48 baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/ 49 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib 50 gpgcheck=1 51 enabled=0 52 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
1 # CentOS-Base.repo 2 # The mirror system uses the connecting IP address of the client and the 3 # update status of each mirror to pick mirrors that are updated to and 4 # geographically close to the client. You should use this for CentOS updates 5 # unless you are manually picking other mirrors. 6 # 7 # If the mirrorlist= does not work for you, as a fall back you can try the 8 # remarked out baseurl= line instead. 9 # 10 # 11 12 [base] 13 name=CentOS-$6 - Base - 163.com 14 baseurl=http://mirrors.163.com/centos/6/os/$basearch/ 15 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os 16 gpgcheck=1 17 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 18 19 #released updates 20 [updates] 21 name=CentOS-$6 - Updates - 163.com 22 baseurl=http://mirrors.163.com/centos/6/updates/$basearch/ 23 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates 24 gpgcheck=1 25 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 26 27 #additional packages that may be useful 28 [extras] 29 name=CentOS-$6 - Extras - 163.com 30 baseurl=http://mirrors.163.com/centos/6/extras/$basearch/ 31 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras 32 gpgcheck=1 33 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 34 35 #additional packages that extend functionality of existing packages 36 [centosplus] 37 name=CentOS-$6 - Plus - 163.com 38 baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/ 39 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus 40 gpgcheck=1 41 enabled=0 42 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 43 44 #contrib - packages by Centos Users 45 [contrib] 46 name=CentOS-$6 - Contrib - 163.com 47 baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/ 48 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib 49 gpgcheck=1 50 enabled=0 51 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6