[2018-08-26]-[CentOS]CentOS更新yum
2018-08-26 本文已影响99人
刘浩_d94d
本文演示CentOS_7.x_64系统更新yum源为阿里云
本文属于个人技术分享,若有错误或遗漏,请联系并在做更改。
CentOS更新yum源
安装wget(若已安装了wget,则跳过此步)
第一步:安装wget;
yum install wget -y

CentOS更新yum源为阿里云
第一步:备份/etc/yum.repos.d/CentOS-Base.repo;
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

第二步:进入yum源配置文件所在文件夹;
cd /etc/yum.repos.d/
第三步:下载aliyun的yum源配置文件,放入/etc/yum.repos.d/下,并更改名称为CentOS-Base.repo;
wget http://mirrors.aliyun.com/repo/Centos-7.repo
mv Centos-7.repo CentOS-Base.repo

第四步:运行yum makecache生成缓存;
yum makecache

第四步:更新yum
yum -y update
第五步: 完毕