In the initial environment settings, we can use Yum as a resident service to automatically update the system. However, the default server is an official site, which is far away from Chinese users and is extremely fast. However, you can modify the corresponding configuration file of Yum to update the system at high speed. The method is as follows:
Modify/etc/yum. Repos. d/CentOS-Base.repo to change the image site address to the site address in China. As follows:
[Base]
CentOS-5-Base
Response List = http: // response list. Centos.org /? Release = $ Releasever5 & arch = x86_64 & repo = OS
Baseurl = http://mirror.centos. Org/centos/5/OS/x86_64/
# Baseurl = http://ftp.hostrino. COM/putb/centos/5.2/OS/x86_64/
Gpgcheck = 1
Gpgkey = http://mirror.centos. Org/centos/rpm-GPG-key-centos- 5
# Released updates
[Update]
CentOS-5-Updates
Response List = http: // response list.Centos.org /? Release = 4 & arch =X86_64 & repo = updates
Baseurl = http://ftp.hostrino.COM/pub/centos/5.2/updates/X86_64/
Gpgcheck = 1
Gpgkey = http://mirror.centos.Org/centos/rpm-GPG-key-centos-5
# Packages used/produced in the build but not released
[Addons]
CentOS-5-Addons
Response List = http: // response list.Centos.org /? Release = 4 & arch =X86_64 & repo = Addons
Baseurl = http://ftp.hostrino.COM/pub/centos/5.2/Addons/x86 _64/
Gpgcheck = 1
Gpgkey = http://mirror.centos.Org/centos/rpm-GPG-key-centos-5
# Additional packages that may be useful
[Extras]
Name = CentOS-5-extras
Response List = http: // response list.Centos.org /? Release = 4 & arch =X86_64 & repo = extras
Baseurl = http://ftp.hostrino.COM/putb/centos/5.2/extras/x86 _64/
Gpgcheck = 1
Gpgkey = http://mirror.centos.Org/centos/rpm-GPG-key-centos-5
# Additional packages that extend functionality of existing packages
[Centosplus]
CentOS-5-plus
Response List = http: // response list.Centos.org /? Release = 4 & arch =X86_64 & repo = centosplus
Baseurl = http://ftp.hostrino.COM/putb/centos/5.2/centosplus/X86_64/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.Org/centos/rpm-GPG-key-centos-5
# Contrib-packages by centos users
[Contrib]
Name = CentOS-5-contrib
Response List = http: // response list.Centos.org /? Release = 4 & arch =X86_64 & repo = contrib
Baseurl = http://ftp.hostrino.COM/pub/centos/5.2/contrib/X86_64/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.Org/centos/rpm-GPG-key-centos-5