The default link of yum is still a foreign mirror, and the speed is relatively unsatisfactory. It will be much faster to configure a domestic mirror. Here, take Ali mirror as an example to configure:
CentOS system replacement software installation source
The first step of the base source
: backup your original image file, so that it can be restored after an error.
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
Step 2: Download the new CentOS-Base.repo to /etc/yum.repos .d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos .d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
epel 源
Epel 5
wget -O /etc/yum.repos.d/epel-5.repo http://mirrors.aliyun.com/repo/Cepel-5.repo
Epel 6
wget -O /etc/yum.repos.d/ epel-6.repo http://mirrors.aliyun.com/repo/epel-6.repo
Epel 7
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
Step 3: Run yum makecache to generate the cache
yum clean all
yum makecache