首页 > 其他 > 详细

CentOS7设置阿里云yum源sh脚本

时间:2018-04-03 15:02:52      阅读:223      评论:0      收藏:0      [点我收藏+]
#!/bin/bash #backup the original repo and use mirrors.aliyun.com as the repository of yum  read -p "Please Enter backup file Name:" BACKNAME if [ -e /etc/yum.repo.d/$BACKNAME ] then echo "Sorry,the name $BACKNAME has been used!" else mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/$BACKNAME &> /dev/null if [ $? -eq 0 ] then wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo &> /dev/null if [ $? -eq 0 ] then echo "Set success!" else echo "Set failure!" fi else echo "backup Error!" fi fi

乱写写CentOS7适用,其他的版本不一样啊...

CentOS7设置阿里云yum源sh脚本

原文:http://blog.51cto.com/1964725/2094234

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!