1、備份源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2、下載新的 CentOS-Base.repo 到 /etc/yum.repos.d/ wget -O /etc/yum.repos ...
1、備份源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下載新的 CentOS-Base.repo 到 /etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
3、非阿裡雲ECS用戶會出現 Couldn't resolve host 'mirrors.cloud.aliyuncs.com' 信息,不影響使用,可以修改配置
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
4、生成緩存
yum makecache
5、查看當前源
yum repolist