在CentOS系统服务器上安装svn的时候,发现找不到我要的包,并且报了一堆的错误,说是fastestmirror过期之类的东西。然后就在网上差了下,果然好多人都有这样的经历,就按照论坛上的说法一步一步来做。下面总结下我的做法:

首先是将yum要打开的源地址,在IE上面跑一下我的是5的版本:http://mirrors.163.com/centos/5/os/i386/CentOS/,发现确实没有找到东西,

这时想到的就是修改源的地址,于是到 /var/cache/yum/下面找到所有的文件并打开其中的mirrorlist.txt,这个东西就是yum在加载镜像的时候读到的源地址。

这是我之前yun目录下的源地址,就是一些个老的旧的源地址

  1. http://mirrors.163.com/centos/5.5/updates/i386/  
  2. http://ftp.cse.yzu.edu.tw/pub/CentOS/5.5/updates/i386/  
  3. http://ftp.tcc.edu.tw/Linux/CentOS/5.5/updates/i386/  
  4. http://ftp.nsysu.edu.tw/Linux/CentOS/5.5/updates/i386/  
  5. http://mirror01.idc.hinet.net/CentOS/5.5/updates/i386/  
  6. http://ftp.twaren.net/Linux/CentOS/5.5/updates/i386/  
  7. http://ftp.daum.net/centos/5.5/updates/i386/  
  8. http://centos.mirror.cdnetworks.com/5.5/updates/i386/  
  9. http://data.nicehosting.co.kr/os/CentOS/5.5/updates/i386/  
  10. http://mirror.khlug.org/centos/5.5/updates/i386/  

那么下来要做的就是在Centos-Base.repo中加入新的源地址。

  1. [[email protected] yum.repos.d]# vim CentOS-Base.repo  
  2. [extras]  
  3. name=CentOS-$releasever - Extras  
  4. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras  
  5. #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/  
  6. gpgcheck=1  
  7. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5  
  8.   
  9. #additional packages that extend functionality of existing packages  
  10. [centosplus]  
  11. name=CentOS-$releasever - Plus  
  12. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo  

还有一种做法是上163镜像上面下载个新的源地址文件http://mirrors.163.com/。centos帮助文档里面找对应版本的repo文件下载。