CentOS7默认的源的网址mirrorlist.centos.org,是国外的网站,可能出现连不上或者网速很慢。我们一般将其设置为阿里yum镜像源。
1.备份本地系统自带yum源配置文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.下载阿里yum源配置文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3.清除yum缓存并且创建缓存
yum clean all && yum makecache