centos换源

linux centos 网易换源

  • 备份源

    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
    
  • 下载国内源

    cd /etc/yum.repos.d/
    
    wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
    
  • CentOS7-Base-163.repo 改名为 CentOS-Base.repo

    mv  CentOS7-Base-163.repo CentOS-Base.repo
    
  • 清除缓存

    yum clean all
    
  • 更新本地yum源缓存

    yum makecache
    
posted @ 2020-03-16 21:28  巫小诗  阅读(153)  评论(0编辑  收藏  举报