一、使用清华yum源
1、备份
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
2、编辑CentOS-Base.repo文件
vi /etc/yum.repos.d/CentOS-Base.repo
3、编辑后的CentOS-Base.repo文件
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.