#!/bin/bash
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
if [ $? -eq 0 ];then
echo "移除成功"
fi
cd /etc/yum.repos.d
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
if [ $? -eq 0 ]; then
echo "下载成功"
fi
yum clean all
if [ $? -eq 0 ]; then
echo "清理成功"
fi
yum makecache
if [ $? -eq 0 ]; then
echo "换源成功"
fi
centos 切换阿里源脚本
最新推荐文章于 2025-05-18 16:25:47 发布