更换yum源为阿里云源

  1. 切换到/etc/yum.repos.d/目录下cd /etc/yum.repos.d

  2. (推荐)备份原有yum源文件mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

  3. 下载阿里云yum源wget -O /etc//yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo CentOS-7.repo(以Centos7为例)

  4. 清理yum缓存yum clean all

  5. 生成新的yum缓存yum makecache

上一篇:yum报错总结


下一篇:yum 换源阿里云