【技术分享】centos更新yum源

2019年2月21日12:06:12 发表评论 828 热度

1.进入yum源配置目录

cd /etc/yum.repos.d

2. 备份原来的yum源,便于恢复,改啥都得留个备份,万一玩儿了还能恢复

mv CentOS-Base.repo CentOS-Base.repo.bk

3. 下载新的CentOS-Base.repo 到/etc/yum.repos.d/

//更新为阿里云的源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

//更新为163的源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

//更新为搜狐的源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

4. 运行yum makecache生成缓存

yum clean all
yum makecache

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: