天天看点

Centos7.3修改yum源为阿里云yum源

  • yum源的位置在 /etc/yum.repos.d 下,Centos-Base.repo为yum源配置文件
Centos7.3修改yum源为阿里云yum源
  • 备份原来的yum文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak           
  • 下载阿里云的 CentOS-Base.repo 到/etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo           

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo           
  • 清空原本yum缓存
yum clean all           
  • 生成新的阿里云的yum缓存,加速下载预热数据
yum makecache           

继续阅读