CentOS handover source yum

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/guopengNo1/article/details/102759270
  1. Backup original image file, to facilitate late recovery
[root@opt ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2. Download the new CentOS-Base.repo to /etc/yum.repos.d/

Centos5地址:
[root@opt ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

Centos6地址:
[root@opt ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

Centos7地址:
[root@opt ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  1. clear cache
[root@opt ~]# yum clean all
  1. Cache generation
[root@opt ~]# yum makecache

Guess you like

Origin blog.csdn.net/guopengNo1/article/details/102759270