访问:http://mirrors.aliyun.com/
找到centos,
按照步骤来:
备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
由于我们用的是centos7,所以
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
如果没装wget就用下边的curl
运行 yum makecache 生成缓存
免责声明:文章源自网络,版权归原作者所有,如有侵犯联系删除。