第一步:备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
第二步:下载repo文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
第三步:将/etc/yum.repos.d/CentOS-Base.repo,里面的http都改成https
sed -i 's/http/https/g' /etc/yum.repos.d/CentOS-Base.repo
第四步:执行yum源更新命令
yum clean all
yum makecache
yum update