1.清除原有RHEL的YUM及相关软件包。
rpm -qa | grep yum | xargs rpm -e --nodeps
查看系统版本
cat /etc/redhat-release
arch
2.下载centos7的相关软件包
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-167.el7.centos.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm
版本目录:https://mirrors.edge.kernel.org/centos/7/os/x86_64/Packages/
3. 安装yum
rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh yum-3.4.3-167.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm python-urlgrabber-3.10-10.el7.noarch.rpm --nodeps --