After Centos 6.2 is installed, we often need to update the system. Normally, the Centos official source is directly used, however, if you use official sources in China to find that the connection speed is very slow, you can use 163 sources to complete system updates more quickly.
The following fengxin network will teach you how to change the Centos 163 source and perform the following operations after logging on to the root user:
Cd/etc/yum. repos. d/# enter the source directory
Mv CentOS-Base.repo CentOS-Base.repo.bak # backup source files
Vi CentOS-Base.repo # editing source files
Replace the following content with the content in the original file
# CentOS-Base.repo
#
# This file uses a new release list system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and
# Update status of each mirror to pick mirrors that are updated to and
# Geographically close to the client. You shoshould use this for CentOS updates
# Unless you are manually picking other mirrors.
#
# If the specified list = does not work for you, as a fall back you can try
# Remarked out baseurl = line instead.
#
#
[Base]
Name = CentOS-$ releasever-Base
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS
# Baseurl = http://developer.centos.org/centos/?releasever/ OS /?basearch/
Baseurl = http://mirrors.163.com/centos/?releasever/ OS /?basearch/
Http://mirrors.ta139.com/centos/?releasever/ OS /?basearch/
Http://centos.ustc.edu.cn/centos/?releasever/ OS /?basearch/
Http://developer.neu.edu.cn/centos/?releasever/ OS /?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
# Released updates
[Updates]
Name = CentOS-$ releasever-Updates
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updates
# Baseurl = http://developer.centos.org/centos/?releasever/updates/?basearch/
Baseurl = http://mirrors.163.com/centos/?releasever/updates/?basearch/
Http://mirrors.ta139.com/centos/?releasever/updates/?basearch/
Http://centos.ustc.edu.cn/centos/?releasever/updates/?basearch/
Http://developer.neu.edu.cn/centos/?releasever/updates/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
# Packages used/produced in the build but not released
[Addons]
Name = CentOS-$ releasever-Updates
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = addons
# Baseurl = http://developer.centos.org/centos/?releasever/addons/?basearch/
Baseurl = http://mirrors.163.com/centos/?releasever/addons/?basearch/
Http://mirrors.ta139.com/centos/?releasever/addons/?basearch/
Http://centos.ustc.edu.cn/centos/?releasever/addons/?basearch/
Http://developer.neu.edu.cn/centos/?releasever/addons/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
# Additional packages that may be useful
[Extras]
Name = CentOS-$ releasever-Extras
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = extras
# Baseurl = http://developer.centos.org/centos/?releasever/extras/?basearch/
Baseurl = http://mirrors.163.com/centos/?releasever/extras/?basearch/
Http://mirrors.ta139.com/centos/?releasever/extras/?basearch/
Http://centos.ustc.edu.cn/centos/?releasever/extras/?basearch/
Http://developer.neu.edu.cn/centos/?releasever/extras/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
# Additional packages that extend functionality of existing packages
[Centosplus]
Name = CentOS-$ releasever-Plus
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = centosplus
# Baseurl = http://developer.centos.org/centos/?releasever/centosplus/?basearch/
Baseurl = http://mirrors.163.com/centos/?releasever/centosplus/?basearch/
Http://mirrors.ta139.com/centos/?releasever/centosplus/?basearch/
Http://centos.ustc.edu.cn/centos/?releasever/centosplus/?basearch/
Http://developer.neu.edu.cn/centos/?releasever/centosplus/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
# Contrib-packages by Centos Users
[Contrib]
Name = CentOS-$ releasever-Contrib
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = contrib
# Baseurl = http://developer.centos.org/centos/?releasever/contrib/?basearch/
Baseurl = http://mirrors.163.com/centos/?releasever/contrib/?basearch/
Http://mirrors.ta139.com/centos/?releasever/contrib/?basearch/
Http://centos.ustc.edu.cn/centos/?releasever/contrib/?basearch/
Http://developer.neu.edu.cn/centos/?releasever/contrib/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
Run the following command to update to the latest system:
# Rpm-import/etc/pki/rpm-gpg-key *
# Yum upgrade