Version: CentOS 6.4
Framework: x86_64
Update Time: updated every 5 hours
1. First back up/etc/yum. repos. d/CentOS-Base.repo
[Root @ localhost ~] # Mv/etc/yum. repos. d/CentOS-Base.repo/etc/yum. repos. d/CentOS-Base.repo.bak
2. Download the repo file of the corresponding version and put it in/etc/yum. repos. d/(back up the file before the operation)
CentOS5
CentOS6
CentOS6
# CentOS-Base.repo
#
# 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-163.com
Baseurl = http://mirrors.163.com/centos/?releasever/ OS /?basearch/
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
# Released updates
[Updates]
Name = CentOS-$ releasever-Updates-163.com
Baseurl = http://mirrors.163.com/centos/?releasever/updates/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updates
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
# Additional packages that may be useful
[Extras]
Name = CentOS-$ releasever-Extras-163.com
Baseurl = http://mirrors.163.com/centos/?releasever/extras/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = extras
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-163.com
Baseurl = http://mirrors.163.com/centos/?releasever/centosplus/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = centosplus
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-163.com
Baseurl = http://mirrors.163.com/centos/?releasever/contrib/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = contrib
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
CentOS5
# CentOS-Base.repo
#
# 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-163.com
Baseurl = http://mirrors.163.com/centos/?releasever/ OS /?basearch/
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# Released updates
[Updates]
Name = CentOS-$ releasever-Updates-163.com
Baseurl = http://mirrors.163.com/centos/?releasever/updates/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updates
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# Packages used/produced in the build but not released
[Addons]
Name = CentOS-$ releasever-Addons-163.com
Baseurl = http://mirrors.163.com/centos/?releasever/addons/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = addons
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# Additional packages that may be useful
[Extras]
Name = CentOS-$ releasever-Extras-163.com
Baseurl = http://mirrors.163.com/centos/?releasever/extras/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = extras
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# Additional packages that extend functionality of existing packages
[Centosplus]
Name = CentOS-$ releasever-Plus-163.com
Baseurl = http://mirrors.163.com/centos/?releasever/centosplus/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = centosplus
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# Contrib-packages by Centos Users
[Contrib]
Name = CentOS-$ releasever-Contrib-163.com
Baseurl = http://mirrors.163.com/centos/?releasever/contrib/?basearch/
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = contrib
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
3. Run yum makecache to generate Cache
[Root @ localhost yum. repos. d] # yum makecache
Loaded plugins: fastestmirror
Metadata Cache Created
Recommended reading:
RedHat Linux local yum source configuration
RedHat 6.2 modify yum source in Linux use CentOS source for free
Configure the epel yum Source
Redhat local yum source configuration
Description of yum configuration file
Install yum in RedHat 6.1)
YUM installation and cleaning