Centos7更换yum源

#!/bin/bash
result=`yum list wget | grep wget | wc -l`
if [ $result -le 1 ]; then
  yum install -y wget
fi
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
posted @ 2021-07-15 13:47  d4peng  阅读(6)  评论(0)    收藏  举报