82870034 发表于 2019-2-15 13:05:17

Centos-7修改yum源为国内的yum源

  国外地址yum源下载慢,下到一半就断了,就这个原因就修改它为国内yum源地址
  国内也就是ali 与 网易
  以centos7为例 ,以 修改为阿里的yum源

[*]备份本地yum源
  mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
  2.获取阿里yum源配置文件
  wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  3.更新cache
  yum makecache
  4.查看
  yum -y update
  5.最后你就可以链接国内镜像了,其实就是那个什么城XXX的 。。。
  mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
  wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  yum makecache
  yum -y update
  ===================================================================
  【更换为163的YUM源】
  cd /etc/yum.repos.d
  wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
  mv ./CentOS-Base.repo ./CentOS-Base.repo.bak
  mv CentOS7-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo
  yum clean all
  yum makecache

页: [1]
查看完整版本: Centos-7修改yum源为国内的yum源