1、安裝wget
yum install -y wget
2、備份
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.bak
3、下載阿里源(如果上面安裝wget命令太慢,或沒安裝wget,也可以直接打開這個地址下載後上傳到Linux的指定目錄/etc/yum.repos.d)
wget http://mirrors.aliyun.com/repo/Centos-7.repo
4、修改阿里源的名稱
mv Centos-7.repo CentOS-Base.repo
5、重建yum
yum clean all
yum makecache
以後yum命令就可以飛速下載安裝了