1. 程式人生 > >CentOS7設置阿裏雲yum源sh腳本

CentOS7設置阿裏雲yum源sh腳本

阿裏雲 shell yum源

#!/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腳本