CentOS7、红帽rhel8添加阿里云yum源方法
1、安装wget下载工具:
yum -y install wget (要确保有本地镜像源才能安装,本地镜像源在安装光盘中,需要挂载到空目录上)
2、备份原有yum源:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup (不需要保留原有yum源可以忽略此步骤)
3、添加阿里云base源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4、 添加阿里云epel源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
5、 检查yum源是否安装成功
运行yum repolist 查看yum仓库
运行yum makecache 生成缓存