CentOS -配置yum源
1 切换到yum目录
cd /etc/yum.repos.d/
2 创建一个备份文件夹
mkdir backup
3 把原配置都放进备份的文件
mv CentOS-* backup
4 下载阿里云YUM源配置文件
方式1 -用curl
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
方式2 -用wget
安装wget
yum install wget -y
用wget安装
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum install xxxxxx
报错sed -i -e ‘/mirrors.cloud.aliyuncs.com/d‘ -e ‘/mirrors.aliyuncs.com/d‘ /etc/yum.repos.d/CentOS-Base.repo
systemctl restart network
原文:https://www.cnblogs.com/ltyc/p/14052972.html