配置網絡yum源 RHEL6.5網絡
1 [root@xuegod163 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 2 3 [root@xuegod163 ~]# sed -i 's/$releasever/6.8/g' /etc/yum.repos.d/CentOS-Base.repo 4 5 [root@xuegod163 ~]# yum clean all 6 7 [root@xuegod163 ~]# yum list
配置網絡yum源RHEL7.2spa
1 [root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 2 3 [root@localhost ~]# sed -i 's/$releasever/7/g' /etc/yum.repos.d/CentOS-Base.repo 4 5 [root@localhost ~]# yum clean all 6 7 [root@localhost ~]# yum list
注:配置網絡yum時,爲了不以前的yum文件相互衝突,建議刪除之間的配置文件 可直接執行rm -rf /etc/yum.repos.d/* 在執行相應配置code