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