RHEL的yum在线更新是收费的,如果没有注册的话是不能使用的
1.rpm -qa | grep yum | xargs rpm -e --nodeps #删除RHEL原有的yum包
2.下载新的yum包
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
3. 安装yum包
rpm -ivh --force python-urlgrabber-3.10-8.el7.noarch.rpm
rpm -ivh yum-*
4. 删除原有yum源
rm -rf /etc/yum.repos.d/*
5. 下载镜像源配置文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
6. 把 /etc/yum.repos.d/CentOS-Base.repo中$releasever替换为版本号7
:%s/$releasever/7/g #快速替换全文
7. 生成yum缓存
yum clean all #清理缓存
yum makecache