1、阿里云yum源的替换

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/

CentOS 5:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3)、之后运行yum makecache fast 生成缓存

yum makecache fast

2、网易163yum源替换

CentOS 5

wget -O /etc/yum.repos.d/CentOS5-Base-163.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo

CentOS 6

wget -O /etc/yum.repos.d/CentOS6-Base-163.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

3、Centos yum源文件的获取

不同的yum的获取途径是不同的;

1)清华镜像

https://mirror.tuna.tsinghua.edu.cn/help/centos/

2)阿里云的镜像文件位置

http://mirrors.aliyun.com/repo/

3)网易163yum文件获取;

http://mirrors.163.com/.help/