How to configure a CentOS or redhat5.x, 6.X, 7.X network Yum Source

Source: Internet
Author: User

The first step: Find a reliable yum source

Zhong Ke
Help: Https://lug.ustc.edu.cn/wiki/mirrors/help/centos
Source: http://mirrors.ustc.edu.cn/centos/
Sohu
Help: Http://mirrors.sohu.com/help/centos.html
Source: http://mirrors.sohu.com/centos/
163
Help: Http://mirrors.163.com/.help/centos.html
Source: http://mirrors.163.com/centos/

Step Two: Configure the Yum source

The links in the Help section of each website in the first step download files that resemble Centos-base.repo (that is, the file in the installation instructions that asks you for the name of the file, which may be different depending on the website, and the content should be the same.) )
For example Zhong Ke's:
[[email protected]/]cd/etc/yum.repos.d[[email protected] yum.repos.d]wget https://  Lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=1

Step three: Replace the $releasever in Centos-base.repo with the corresponding version

The first thing to ensure is that the replaced version has content underneath.
For example, I used the Red Hat 6.2 version of the system, but only 6.7 of the "source" links in each of the first steps contained content. Then I'll replace all the $releasever with 6.7.
[[email protected] yum.repos.d]vim centos-base.repovim Command mode:1, $s/$releasever/6.7/G : Wq

Save exit

Fourth step: Update the Yum source

[[email protected] Yum.repos.d]yum clean all[[email protected] Yum.repos.d]yum Makecache

End

Appendix: Installing Epel is also the same

First: Find the resource http://mirrors.opencas.cn/epel/, choose your own system version and number of bits (32 select i386/,64 x86_64/), and then download to local, such as:

[Email protected]/]wget http://mirrors.opencas.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm

Then: Just install it, okay?

[Email protected]/]RPM-IVH epel-release-6-8.noarch.rpm
[[email protected]/]yum clean all
[Email protected]/]yum Makecache

End

How to configure a CentOS or redhat5.x, 6.X, 7.X network Yum Source

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.