免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8313 | 回复: 3

升级到CentOS5后较快yum配置(国内源) [复制链接]

论坛徽章:
0
发表于 2007-05-11 22:21 |显示全部楼层
今天中午花了两个多小时用硬盘安装盘升级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
复制代码

论坛徽章:
0
发表于 2007-05-12 15:56 |显示全部楼层

回复 #1 ErwinZ 的帖子

这个源rhel 5 client 能不能用阿?如果能,应该怎么设置阿?

论坛徽章:
0
发表于 2007-05-14 01:40 |显示全部楼层
rhel 5 client 不清楚,不过我在server试成功了

论坛徽章:
0
发表于 2007-06-19 11:05 |显示全部楼层
从 CentOS-5/Beta 在线更新:
我们推荐一个全新的安装,然而适当的从CentOS-5/Beta更新到CentOS-5/Final也是可以的.用以下步骤:
步骤-1) init 3
步骤-2) yum clean all;
步骤-3) yum --disablerepo=* --enablerepo=base --enablerepo=updates update yum* rpm*
步骤-4) yum clean all;
步骤-5) yum --disablerepo=* --enablerepo=base --enablerepo=updates
步骤-6)upgrade  (这里原创好像有点问题,好像应该是:yum upgrade)

对于最后一步,最好做一个'upgrade'而不是一个'update'。关于upgrade和update选项的不同在yum的man手册面有详细介绍.
当然,围绕dbus重启问题,在yum之前init 3是很重要的,也是被广泛报道的.
用新版本的yum做主要更新会加快更新速度多达4倍,所以推荐首先升级yum.

下载介绍里抄来的,按上面6个步骤,我试了一下可以正常升级。升级速度快慢没感觉,如果实在太慢无法忍受,参照LZ更改为sjtu的mirror应该不难。总之先保证能够成功的完成升级就放心了,快慢以后再计较。

[ 本帖最后由 ljy88 于 2007-6-19 11:08 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP