配置阿里云yum源

  1. 下载安装wget
yum install -y wget
  1. 备份默认的yum
mv /etc/yum.repos.d /etc/yum.repos.d.backup
  1. 设置新的yum目录
mkdir -p /etc/yum.repos.d
  1. 下载阿里yum配置到该目录中,选择对应版本
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  1. 更新epel源为阿里云epel源
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup 
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
  1. 重建缓存
yum clean all 
yum makecache
  1. 看一下yum仓库有多少包
yum repolist
yum update 
上一篇:linux命令荟萃


下一篇:Centos-Minimal网络配置