centos 6/7 yum源更换为阿里云源,添加EPEL源.

文章目录

删除 原yum源
rm -f /etc/yum.repos.d/* #删除自带的yum源
或者 备份
mkdir /etc/yum.repos.d/backup
mv /etc/yum.repos.d/* /etc/yum.repos.d/backup/

阿里云源

必须严格根据 系统版本 选择相应yum源

  • CentOS 6

    wget http://mirrors.aliyun.com/repo/Centos-6.repo -O /etc/yum.repos.d/CentOS-Base.repo
    
  • CentOS 7

    wget http://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
    
  • 清理缓存并生成新的缓存

    yum clean all  
    yum makecache
    

EPEL源

必须严格根据 系统版本 选择相应yum源

  • Centos6

    wget http://mirrors.aliyun.com/repo/epel-6.repo -O /etc/yum.repos.d/epel-6.repo 
    
  • Centos7

    wget http://mirrors.aliyun.com/repo/epel-7.repo  -O /etc/yum.repos.d/epel-7.repo
    
  • 清理缓存并生成新的缓存

    yum clean all  
    yum makecache
    
发布了4 篇原创文章 · 获赞 1 · 访问量 253

猜你喜欢

转载自blog.csdn.net/wrtwen/article/details/104292547