Centos7一键配置阿里云yum源脚本

时间:2023-03-09 16:59:34
Centos7一键配置阿里云yum源脚本

Centos7一键配置阿里云yum源脚本

工作中linux系统经常要配置网络yum,故写了一个简单的配置阿里云yum源的的脚本可以单独使用也可以在做自动化部署的时候调用。

#!/bin/bash
# *********************************************************
# * Author : Lchen
# * Email : chn1970@qq.com
# * Create Time : 2020-10-13 10:00
# * Description : Configure alicloud Yum source
# * Version : V1.0
# * Last modified : 0000-00-00 00:00
# * Blog Site: : https://www.cnblogs.com/lcxhk/p/14109408.html
# * ******************************************************* cd /etc/yum.repos.d/

test -d bak || mkdir bak && mv * bak wget http://mirrors.aliyun.com/repo/Centos-7.repo wget http://mirrors.aliyun.com/repo/epel-7.repo yum clean all
yum repolist