Linux(CentOS7)修改默认yum源为国内的阿里云、网易yum源
修改方式:
echo 备份当前的yum源 mv /etc/yum.repos.d /etc/yum.repos.d.backup4comex echo 新建空的yum源设置目录 mkdir /etc/yum.repos.d echo 下载阿里云的yum源配置 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
然后重建缓存:
yum clean all yum makecache
========================我是可爱的分割线========================
执行报错“-bash: wget: command not found”的解决方式
执行报错:
原来默认的centos最小版是没有安装wget的。我们需要先yum安装一下。
回滚配置
cp /etc/yum.repos.d.backup4comex/* /etc/yum.repos.d
然后yum安装wget
yum -y install wget
然后再次获取:
rm -rf /etc/yum.repos.d mkdir /etc/yum.repos.d wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

![clipboard[1]](https://images2015.cnblogs.com/blog/897329/201608/897329-20160828184024012-1495320269.png)
![clipboard[2]](https://images2015.cnblogs.com/blog/897329/201608/897329-20160828184034934-369988220.png)
浙公网安备 33010602011771号