[TOC] ## 备份 `mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup ` ## 下载 CentOS 5 `wget -O /etc/yum.repos.d/CentOS-163-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo` CentOS 6 `wget -O /etc/yum.repos.d/CentOS-163-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo` CentOS 7 `wget -O /etc/yum.repos.d/CentOS-163-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo ` ## 更改 CentOS-Media.repo 更改CentOS-Media.repo使其为不生效(0表示不生效,1表示生效.不写这句话表示默认生效): `enabled=0 ` ## 执行 ``` yum clean all yum makecache ```