LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 4366|回复: 1

centOS5的较快yum配置(国内)

[复制链接]
发表于 2007-5-11 22:04:58 | 显示全部楼层 |阅读模式
今天中午花了两个多小时用硬盘安装盘升级centos4.2到centos5.0,后来一直在寻找新的yum配置,网上一直找不到,最后自己改写了一些代码,服务器是sjtu的,国内的还比较快。

首先,由于直接升级,/etc/下出现了一个新的yum.conf.rpmnew,同时/etc/yum.repos.d/出现新的CentOS-Base.repo.rpmnew,实际旧的两个配置还是保留了,这两个是新的yum配置文件,首先把这2个覆盖旧配置。


  1. #cd /etc
  2. #cp yum.conf.rpmnew yum.conf
  3. #cd /etc/yum.repos.d
  4. #cp CentOS-Base.repo.rpmnew CentOS-Base.repo
复制代码

需要注意的是,在yum.conf中启动了plugin支持,如果原来安装了旧的插件比如寻找最快源yum-fastestmirror,用在centos5中可能就会出错,所以必须先卸载或者把yum.conf中的plugin支持去掉,安装新的centos5的这个插件。

我的CentOS-Base.repo配置如下(sjtu的mirror,某些注释没去掉):

  1. [base]
  2. name=CentOS-5 - Base
  3. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&
  4. repo=os
  5. #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
  6. baseurl=http://ftp.sjtu.edu.cn/centos/5.0/os/$basearch/
  7. gpgcheck=1
  8. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

  9. #released updates
  10. [update]
  11. name=CentOS-5 - Updates
  12. #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates
  13. baseurl=http://ftp.sjtu.edu.cn/centos/5.0/updates/$basearch/
  14. gpgcheck=1
  15. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

  16. #packages used/produced in the build but not released
  17. [addons]
  18. name=CentOS-5 - Addons
  19. #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons

  20. baseurl=http://ftp.sjtu.edu.cn/centos/5.0/addons/$basearch/
  21. gpgcheck=1
  22. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

  23. #additional packages that may be useful
  24. [extras]
  25. name=CentOS-5 - Extras
  26. #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras

  27. baseurl=http://ftp.sjtu.edu.cn/centos/5.0/extras/$basearch/
  28. gpgcheck=1
  29. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

  30. #additional packages that extend functionality of existing packages
  31. [centosplus]
  32. name=CentOS-5 - Plus
  33. #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus
  34. baseurl=http://ftp.sjtu.edu.cn/centos/5.0/centosplus/$basearch/
  35. gpgcheck=1
  36. enabled=0
  37. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

  38. #contrib - packages by Centos Users
  39. [contrib]
  40. name=CentOS-5 - Contrib
  41. #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
  42. baseurl=http://ftp.sjtu.edu.cn/centos/5.0/contrib/$basearch/
  43. gpgcheck=1
  44. enabled=0
  45. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
复制代码
发表于 2007-5-12 11:18:16 | 显示全部楼层
不错,教育网的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表