Change centosyum to a Chinese image to speed up yum

Source: Internet
Author: User
Tags gpg
If the above YUM source is used, it is best to comment out the rule list in it, otherwise the system will start the fastesmirror plug-in automatically

163 open source image address http://mirrors.163.com/.help/CentOS-Base-163.repo
Different versions see http://mirrors.163.com/.help/centos.html

Sohu open source image address http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
Different versions see http://mirrors.sohu.com/help/centos.html

University of Science and Technology http://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos? Codeblock = 2
Different versions see http://lug.ustc.edu.cn/wiki/mirrors/help/centos

If the above YUM source is used, it is best to putShortlistComment out, otherwise the system will startFastesmirrorThe agent automatically checks and does not necessarily use this yum source.

I am using the University of Science and Technology of China at a good speed.

Method 1: directly download the source file

CentOS USTC mirror is a good image. you can update and use this image.

# Yum-y install wget
# Cd/etc/yum. repos. d
# Mv CentOS-Base.repo CentOS-Base.repo.save
# Wget http://centos.ustc.edu.cn/CentOS-Base.repo
# Yum makecache

Note: If it is the first time to install a new system, you need to first install the wget download software, otherwise there is no way to download the CentOS-Base.repo file.

Method 2: manually create source files

Change the yum image site to the Chinese site address. we recommend that you use http://centos.ustc.edu.cn/centos /. (China University of Science and Technology)

# Cd/etc/yum. repos. d/

# Mv CentOS-Base.repo CentOS-Base.repo.bak

# Vi CentOS-Base.repo

Modify/Etc/yum. repos. d/CentOS-Base.repoAs follows:

# ------------ Within the split line ----------------

# 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
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS
Baseurl = http://centos.ustc.edu.cn/centos/?releasever/ OS /?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

# Released updates
[Updates]
Name = CentOS-$ releasever-Updates
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updates
Baseurl = http://centos.ustc.edu.cn/centos/?releasever/updates/?basearch/
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
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = addons
Baseurl = http://centos.ustc.edu.cn/centos/?releasever/addons/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

# Additional packages that may be useful
[Extras]
Name = CentOS-$ releasever-Extras
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = extras
Baseurl = http://centos.ustc.edu.cn/centos/?releasever/extras/?basearch/
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
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = centosplus
Baseurl = http://centos.ustc.edu.cn/centos/?releasever/centosplus/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

# ------------ Within the split line ----------------

Simply put, comment out the tranquility list and change the baseurl to the image address of centos.ustc.edu.cn.

Run the following command to test:

# Yum upgrade
# Yum makecache

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.