对在中国的CentOS支持者们,一件好事情:CentOS终于有了在中国的镜像,分别设在上海、香港、福建。
活用这个资源的之一,就是通过yum高速更新系统。
在初始环境设置中,我们可以将yum作为一项常驻的服务自动更新系统,但默认的服务器是官方的站点,离中国用户比较远,速度不堪忍受。但修改yum相应配置文件就可以达到高速更新系统的目的,方法如下:
修改/etc/yum.repos.d/CentOS-Base.repo,将镜象站点地址改为在中国的景象站点地址。如下:
- # CentOS-Base.repo
- #
- # This file uses a new mirrorlist system developed by Lance Davis for CentOS.
- # The mirror system uses the connecting IP address of the client and the
- # update status of each mirror to pick mirrors that are updated to and
- # geographically close to the client. You should use this for CentOS updates
- # unless you are manually picking other mirrors.
- #
- # If the mirrorlist= does not work for you, as a fall back you can try the
- # remarked out baseurl= line instead.
- #
- #
- [base]
- name=CentOS-$releasever - Base
- baseurl=
-
-
-
- gpgcheck=1
- gpgkey=
- #released updates
- [update]
- name=CentOS-$releasever - Updates
- baseurl=
-
-
-
- gpgcheck=1
- gpgkey=
- #packages used/produced in the build but not released
- [addons]
- name=CentOS-$releasever - Addons
- baseurl=
-
-
-
- gpgcheck=1
- gpgkey=
- #additional packages that may be useful
- [extras]
- name=CentOS-$releasever - Extras
- baseurl=
-
-
-
- gpgcheck=1
- gpgkey=
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-$releasever - Plus
- baseurl=
- gpgcheck=1
- enabled=0
- gpgkey=
- #contrib - packages by Centos Users
- [contrib]
- name=CentOS-$releasever - Contrib
- baseurl=
- gpgcheck=1
- enabled=0
- gpgkey=
复制代码 然后更新一次系统,并将yum设置为自启动,让其即时自动为系统更新。
# yum -y update
# chkconfig yum on
# /etc/rc.d/init.d/yum start
阅读(677) | 评论(0) | 转发(0) |