centos7 怎么更换镜像源


  1. 首先备份/etc/yum.repos.d/CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

    2.下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)

Centos7:

wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS7-Base-163.repo

Centos6:

wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS6-Base-163.repo

Centos5:

wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS5-Base-163.repo

 

    3.运行以下命令生成缓存

yum clean all
yum makecache


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM