引用自: http://fkblog.sinaapp.com/blog11
###一、建立yum安装包目录,并进入到该目录:
mkdir /usr/local/src/yum-packages (个人习惯将安装文件统一放在/usr/local/src/目录)
cd /usr/local/src/yum-packages
###二、下载yum所需的所有rpm包:
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
wget http://mirrors.sohu.com/centos/5.5/os/i386/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm
wget http://mirrors.sohu.com/centos/5.5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
###三、先安装python环境:
rpm -ivh python-iniparse-0.2.3-4.el5.noarch.rpm
###四、安装所有的yum包:
rpm -ivh yum-3.2.22-26.el5.centos.noarch.rpm yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
###五、下载配置文件
wget http://mirrors.ustc.edu.cn/centos/CentOS-Base.5.mirrors.repo -O /etc/yum.repos.d/CentOS-Base.repo
还有一个源(http://sudone.com/download/CentOS-Base.repo )
修改CentOS-Base.repo
(没有修改会报错)
vim /etc/yum.repos.d/CentOS-Base.repo
进入命令模式
:%s//$releasever/5/g
:wq
###六、执行
yum update