关于linux:Centos7-更换国内源

5次阅读

共计 317 个字符,预计需要花费 1 分钟才能阅读完成。

  1. 备份本地源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
  1. 更新国内源

针对国内源有很多,个别咱们抉择 阿里 或者 163
阿里:http://mirrors.aliyun.com/rep…
163:http://mirrors.163.com/.help/…

我这里应用阿里

 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  1. 清空 yum 缓存
yum clean all
  1. 重建 yum 缓存
yum makecache
  1. 更新 yum
yum upgrade
正文完
 0