Centos 7 修改yum源为阿里源

时间:2023-03-10 01:14:05
Centos 7 修改yum源为阿里源

因为官方的yum源在国内访问效果不佳,

需要改为国内比较好的阿里云或者网易的yum源,

具体修改步骤如下:

cd /etc/yum.repos.d

# 备份旧的配置文件
mv CentOS-Base.repo CentOS-Base.repo.bck # 下载阿里源的文件
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo # 清理缓存
yum clean all # 重新生成缓存
yum makecache