yum源配置方法之一(阿里云源或者腾讯云 )
- 安装wget
yum install -y wget
- 备份/etc/yum.repos.d/CentOS-Base.repo和epel.repo 文件
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.back
mv epel.repo epel.repo.back
- 下载阿里云的Centos-7.repo文件
阿里云
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
腾讯云
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-7.repo
- 重新加载yum
yum clean all
yum makecache