本文使用工具:
RedHat Enterprise Linux 6 x64
vim 编辑器
01.在安装完RedHat Enterprise Linux系统后, 由于 redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,请配置其他YUM源,以下为详细过程。(此过程不需卸载RedHat Enterprise Linux (RHEL) 自己的YUM程序)
02.安装的RedHat Enterprise Lunux系统版本
# lsb_release -a (适用于所有的linux,包括Redhat、SuSE、Debian等发行版,但是在debian下要安装lsb)
# cat /etc/issue (显示的是发行版本信息)
# cat /proc/version (说明正在运行的内核版本)
# uname -a (可显示电脑以及操作系统的相关信息)

03.进入YUM源目录:
# cd /etc/yum.repos.d

04.先把自带的YUM源配置文件备份一下,说不定以后会用的到:
# mv rhel-source.repo rhel-source.repo.bak

05.从阿里云上下载CentOS的YUM源配置文件:
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

06.编辑CentOS-Base.repo文件:
# vim CentOS-Base.repo

07.将文件里的所有$releasever替换6.7,保存退出:



08.清理YUM缓存等文件:
# yum clean all

09.运行yum makecache生成缓存:
# yum makecache

10.完成,已将RedHat Enterprise Linux 6 (RHEL 6)的YUM源切换至阿里云的CentOS 6的YUM源,现在随便装个程序测试一下:
# yum -y update

大功告成。