CentOS7切换阿里云/清华大学yum源,添加epel源

清华大学:https://mirrors.tuna.tsinghua.edu.cn/help/centos/
阿里云:https://opsx.alibaba.com/mirror?lang=zh-CN
阿里云epel:https://developer.aliyun.com/mirror/epel?spm=a2c6h.13651102.0.0.53322f70YiCHXm

阿里云

  1. 备份

    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  2. 下载新的CentOS-Base.repo 到/etc/yum.repos.d/

    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
  3. 清理一下yum缓存

    yum clean all
  4. 运行 yum makecache 生成缓存

    yum makecache

    搞定!

你可能感兴趣的:(Linux)