RHEL系统部署网络yum源

来源:互联网 发布:淘宝返利链接怎么做 编辑:程序博客网 时间:2024/05/19 03:46

配置网络yum源

RHEL系统本身光盘做成的yum源所提供的软件包有限,在实际使用过程中经常会出现缺包的现象,本文中以CentOS源作为替代,CentOS的软件包和RHEL系统是互相兼容的,而且CentOS公司已被RHEL收购,所以不会出现兼容性的问题,可以放心使用

RHEL6.5

[root@xuegod163~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

[root@xuegod163~]# sed -i 's/$releasever/6.7/g' /etc/yum.repos.d/CentOS-Base.repo

[root@xuegod163~]# yum clean all

[root@xuegod163~]# yum list


RHEL7.2

[root@localhost~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

[root@localhost~]# sed -i 's/$releasever/7/g'  /etc/yum.repos.d/CentOS-Base.repo

[root@localhost~]# yum clean all

[root@localhost~]# yum list


注:配置网络yum时,为了避免之前的yum文件相互冲突,建议删除之间的配置文件

可直接执行rm -rf/etc/yum.repos.d/* 在执行相应配置

1 0