1. 查看CentOS7.9版本
cat /etc/centos-release
2.查看默认安装Yum
rpm -qa|grep yum
3.卸载已经安装的Yum
rpm -aq|grep yum|xargs rpm -e --nodeps
4.创建yum文件夹
mkdir /usr/local/src/yum
5.下载yum安装包(cd /usr/local/src/yum )
rpm -ivh --nodeps http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh --nodeps http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
rpm -ivh --nodeps http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
6.不考虑依赖包,强制安装
rpm -ivh --force --nodeps *.rpm
7.查看版本是否安装成功
rpm -qa|grep yum
安装yum结束。