歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> CentOS 6.0 國外服務器如何安裝更新源

CentOS 6.0 國外服務器如何安裝更新源

日期:2017/2/28 15:54:59   编辑:Linux教程

國外服務器有的不能直接訪問到163的CentOS源,搞了很久才搞定,下面貼出具體方法:

1.進入/etc/yum.repos.d,新建文件mirrors-rpmforge,然後寫入以下地址:

  1. http://apt.sw.be/RedHat/el5/en/$ARCH/dag
  2. http://archive.cs.uu.nl/mirror/dag.wieers/redhat/el5/en/$ARCH/dag
  3. http://ftp2.lcpe.uni-sofia.bg/freshrpms/pub/dag/redhat/el5/en/$ARCH/dag
  4. #http://ftp.heanet.ie/pub/freshrpms/pub/dag/redhat/el5/en/$ARCH/dag
  5. http://ftp-stud.fht-esslingen.de/dag/redhat/el5/en/$ARCH/dag
  6. http://mirror.cpsc.ucalgary.ca/mirror/dag/redhat/el5/en/$ARCH/dag
  7. http://mirrors.ircam.fr/pub/dag/redhat/el5/en/$ARCH/dag
  8. http://rh-mirror.linux.iastate.edu/pub/dag/redhat/el5/en/$ARCH/dag
  9. http://rpmfind.net/linux/dag/redhat/el5/en/$ARCH/dag
  10. http://wftp.tu-chemnitz.de/pub/linux/dag/redhat/el5/en/$ARCH/dag
  11. http://www.mirrorservice.org/sites/apt.sw.be/redhat/el5/en/$ARCH/dag

2.新建文件rpmforge.repo,然後寫入以下內容:

  1. # Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
  2. # URL: http://rpmforge.net/
  3. [rpmforge]
  4. name = Red Hat Enterprise $releasever - RPMforge.net - dag
  5. #baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag
  6. mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
  7. #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
  8. enabled = 1
  9. protect = 0
  10. gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  11. 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 國外服務器如何安裝更新源/

Copyright © Linux教程網 All Rights Reserved