1首先备份原来的配置文件:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2下载对应版本repo文件, 放入/etc/yum.repos.d/
3生成缓存:
yum clean all yum makecache