修改yum为阿里源

背景

1、默认源安装速度慢
2、可能会出现没有可用软件包xxx 错误:无须任何处理的错误

设置为阿里源

  • 首先备份旧的镜像源
    mv /etc/yum.repo.d/Centos-Base.repo /etc/yum.repo.d/Centos-Base.repo.bak
  • 然后下载并配置阿里源
wget -O /etc/yum.repo.d/Centos-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 
//根据centos版本来改版本
  • 清理缓存再重新设置
yum clean all
yum makecache

你可能感兴趣的:(修改yum为阿里源)