Linux的yum源自动化配置shell脚本
#!/usr/bin/env bash
#注意可以自己调整注释可以切换
set -e
# Locate shell script path
SCRIPT_DIR=$(dirname $0)
if [ ${SCRIPT_DIR} != '.' ]
then
cd ${SCRIPT_DIR}
fi
#curl -o /etc/yum.repos.d/CentOS7-Aliyun.repo https://raw.githubusercontent.com/cookcodeblog/OneDayDevOps/master/components/aliyun/CentOS7-Aliyun.repo
curl -o /etc/yum.repos.d/epel-7-Aliyun.repo https://raw.githubusercontent.com/cookcodeblog/OneDayDevOps/master/components/aliyun/epel-7-Aliyun.repo
cp CentOS7-Aliyun.repo /etc/yum.repos.d/
#cp epel-7-Aliyun.repo /etc/yum.repos.d/
yum clean all
yum makecache
#yum makecache fast
yum repolist all