Redhat EL5.4用CentOS源进行更新



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=http://centos.ustc.edu.cn/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[update]
name=CentOS-5 - Updates
baseurl=http://centos.ustc.edu.cn/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[addons]
name=CentOS-5 - Addons
baseurl=http://centos.ustc.edu.cn/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[extras]
name=CentOS-5 - Extras
baseurl=http://centos.ustc.edu.cn/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[centosplus]
name=CentOS-5 - Plus
baseurl=http://centos.ustc.edu.cn/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[contrib]
name=CentOS-5 - Contrib
baseurl=http://centos.ustc.edu.cn/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

3.从http://centos.ustc.edu.cn/centos/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.如果http://centos.ustc.edu.cn/centos这个服务器的CentOS映像不够快的话用自己适合的服务器替换,可以用IE上去先看看

5.导入KEY文件,注意大小写
rpm --import http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

6.测试
#yum list
注意:因为需要解析域名,所以需要先配置好DNS,不建议直接用IP地址

转载整理:
http://arksea.javaeye.com/blog/540374

你可能感兴趣的:(centos,redhat,OS,Blog,IE)