Chinaunix首页 | 论坛 | 博客
  • 博客访问: 856025
  • 博文数量: 254
  • 博客积分: 5350
  • 博客等级: 大校
  • 技术积分: 2045
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-27 13:27
文章分类

全部博文(254)

文章存档

2015年(1)

2014年(9)

2013年(17)

2012年(30)

2011年(150)

2010年(17)

2009年(28)

2008年(2)

分类: LINUX

2010-05-20 16:43:00

对在中国的CentOS支持者们,一件好事情:CentOS终于有了在中国的镜像,分别设在上海、香港、福建。

活用这个资源的之一,就是通过yum高速更新系统。

在初始环境设置中,我们可以将yum作为一项常驻的服务自动更新系统,但默认的服务器是官方的站点,离中国用户比较远,速度不堪忍受。但修改yum相应配置文件就可以达到高速更新系统的目的,方法如下:

修改/etc/yum.repos.d/CentOS-Base.repo,将镜象站点地址改为在中国的景象站点地址。如下:

  1. # CentOS-Base.repo
  2. #
  3. # This file uses a new mirrorlist system developed by Lance Davis for CentOS.
  4. # The mirror system uses the connecting IP address of the client and the
  5. # update status of each mirror to pick mirrors that are updated to and
  6. # geographically close to the client.  You should use this for CentOS updates
  7. # unless you are manually picking other mirrors.
  8. #
  9. # If the mirrorlist= does not work for you, as a fall back you can try the
  10. # remarked out baseurl= line instead.
  11. #
  12. #

  13. [base]
  14. name=CentOS-$releasever - Base
  15. baseurl=
  16.         
  17.         
  18.         
  19. gpgcheck=1
  20. gpgkey=

  21. #released updates
  22. [update]
  23. name=CentOS-$releasever - Updates
  24. baseurl=
  25.         
  26.         
  27.         
  28. gpgcheck=1
  29. gpgkey=

  30. #packages used/produced in the build but not released
  31. [addons]
  32. name=CentOS-$releasever - Addons
  33. baseurl=
  34.         
  35.         
  36.         
  37. gpgcheck=1
  38. gpgkey=

  39. #additional packages that may be useful
  40. [extras]
  41. name=CentOS-$releasever - Extras
  42. baseurl=
  43.         
  44.         
  45.         
  46. gpgcheck=1
  47. gpgkey=

  48. #additional packages that extend functionality of existing packages
  49. [centosplus]
  50. name=CentOS-$releasever - Plus
  51. baseurl=
  52. gpgcheck=1
  53. enabled=0
  54. gpgkey=

  55. #contrib - packages by Centos Users
  56. [contrib]
  57. name=CentOS-$releasever - Contrib
  58. baseurl=
  59. gpgcheck=1
  60. enabled=0
  61. gpgkey=
复制代码


然后更新一次系统,并将yum设置为自启动,让其即时自动为系统更新。

# yum -y update

# chkconfig yum on

# /etc/rc.d/init.d/yum start
阅读(646) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~