The default download address for CentOS's yum is not in China, and the download speed in China is extremely slow. Generally, you can change the YUM mirror address to improve the download speed of software packages.
The following two methods can be used to modify the mirror address:
- Install yum-fastestmirror to automatically select the fastest mirror for downloading.
- Change the download mirror address and select a domestic mirror address for downloading.
Please note that if fastestmirror is installed, the modified mirror address may become invalid due to the use of dynamically selected mirror addresses by the plugin.
Method 1
yum install yum-plugin-fastestmirror
Method 2
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.bak
wget http://mirrors.163.com/.help/CentOS-Base-163.repo
mv CentOS-Base-163.repo CentOS-Base.repo
Recommended mirrors:
Public Network
163 NetEase: http://mirrors.163.com/.help/CentOS-Base-163.repo
Sohu: http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
Education Network/Public Network
University of Science and Technology of China: http://centos.ustc.edu.cn/CentOS-Base.repo