国外服务器有的不能直接访问到163的CentOS源,搞了很久才搞定,下面贴出具体方法:
1.进入/etc/yum.repos.d,新建文件mirrors-rpmforge,然后写入以下地址:
- http://apt.sw.be/RedHat/el5/en/$ARCH/dag
- http://archive.cs.uu.nl/mirror/dag.wieers/redhat/el5/en/$ARCH/dag
- http://ftp2.lcpe.uni-sofia.bg/freshrpms/pub/dag/redhat/el5/en/$ARCH/dag
- #http://ftp.heanet.ie/pub/freshrpms/pub/dag/redhat/el5/en/$ARCH/dag
- http://ftp-stud.fht-esslingen.de/dag/redhat/el5/en/$ARCH/dag
- http://mirror.cpsc.ucalgary.ca/mirror/dag/redhat/el5/en/$ARCH/dag
- http://mirrors.ircam.fr/pub/dag/redhat/el5/en/$ARCH/dag
- http://rh-mirror.linux.iastate.edu/pub/dag/redhat/el5/en/$ARCH/dag
- http://rpmfind.net/linux/dag/redhat/el5/en/$ARCH/dag
- http://wftp.tu-chemnitz.de/pub/linux/dag/redhat/el5/en/$ARCH/dag
- http://www.mirrorservice.org/sites/apt.sw.be/redhat/el5/en/$ARCH/dag
2.新建文件rpmforge.repo,然后写入以下内容:
- # Name: RPMforge RPM Repository for Red Hat Enterprise 5 – dag
- # URL: http://rpmforge.net/
- [rpmforge]
- name = Red Hat Enterprise $releasever – RPMforge.net – dag
- #baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag
- mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
- #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
- enabled = 1
- protect = 0
- gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
- gpgcheck = 1
3.修改这2个文件权限,先执行一下rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt注册RPM-GPG-KEY.dag,最后测试一下,执行yum clean all
4.这样就可以直接更新到这些新源了,然后执行yum search rz试试,等全部更新完就OK了
5.CentOS5和CentOS6均成功
6.附件上传了以上2个文件
免费下载地址在 http://linux.linuxidc.com/
用户名与密码都是www.linuxidc.com
具体下载目录在 /2012年资料/3月/8日/CentOS 6.0 国外服务器如何安装更新源/