配置网络yum源

有的时候服务器须要下载一些软件,是本地yum源没有的,这时候须要配置网络yum源centos

#cd  /etc/yum.repos.d/服务器

把这个目录下的配置文件备份,更名;或者是把文件里边的enabled=1的改成enabled=0;网络

 

# wget -O /etc/yum.repos.d/CentOS-Base.repo   http://mirrors.aliyun.com/repo/Centos-6.repo阿里云

# sed -i  's/$releasever/6/g' /etc/yum.repos.d/CentOS-Base.repourl

# yum clean allget

# yum listsed

以上是配置RHEL6.5的,下边是配置 RHEL7.2软件

# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo配置

# sed -i  's/$releasever/7/g' /etc/yum.repos.d/CentOS-Base.repo下载

# yum clean all

# yum list

 

 

阿里云的网络yum源通常够用了;你能够用其余的,url换一下而已,还有搜狐的  http://mirrors.sohu.com   中科大 http://centos.ustc.edu.cn

相关文章
相关标签/搜索