mv /etc/yum.repos.d /etc/yum.repos.d.backup
mkdir /etc/yum.repos.d
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all yum makecache
yum upgrade -y yum -y update:升级所有包同时,也升级软件和系统内核;(时间比较久) yum -y upgrade:只升级所有包,不升级软件和系统内核,软件和内核保持原样