1.备份或删除yum源配置文件
#cd /etc/yum.repos.d
#mv rhel-debuginfo.repo rhel-debuginfo.repo.bak
2.编辑CentOS-Base.repo,填入以下内容
######################
[base]
name=CentOS-5 - Base
repo=os
baseurl=
gpgcheck=1
gpgkey=
[update]
name=CentOS-5 - Updates
baseurl=5.4/updates/$basearch/
gpgcheck=1
gpgkey=
[addons]
name=CentOS-5 - Addons
baseurl=5.4/addons/$basearch/
gpgcheck=1
gpgkey=
[extras]
name=CentOS-5 - Extras
baseurl=5.4/extras/$basearch/
gpgcheck=1
gpgkey=
[centosplus]
name=CentOS-5 - Plus
baseurl=5.4/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=
[contrib]
name=CentOS-5 - Contrib
baseurl=5.4/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=
###################
3.从5.4/os/i386/CentOS/下载以下文件并安装
yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm
yum-3.2.22-20.el5.centos.noarch.rpm
yum-updatesd-0.9-2.el5.noarch.rpm
或者找个FTP站点用wget下载:
#wget
ftp://ftp.pdc.kth.se/pub/bambi/centos/5.4/os/i386/CentOS/yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm
#wget
ftp://ftp.pdc.kth.se/pub/bambi/centos/5.4/os/i386/CentOS/yum-3.2.22-20.el5.centos.noarch.rpm
#wget
ftp://ftp.pdc.kth.se/pub/bambi/centos/5.4/os/i386/CentOS/yum-updatesd-0.9-2.el5.noarch.rpm
#rpm -ivh yum*.rpm
4.如果这个服务器的CentOS映像不够快的话用自己适合的服务器替换,可
以用IE上去先看看
5.导入KEY文件,注意大小写
rpm --import
6.测试下
#yum list
注意:因为需要解析域名,所以需要先配置好DNS,不建议直接用IP地址
阅读(1040) | 评论(0) | 转发(0) |