1.查看软件包:
[root@localhost ~]# rpm -qa|grep yum
yum-utils-1.1.31-54.el7_8.noarch
yum-3.4.3-167.el7.centos.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-plugin-fastestmirror-1.1.31-53.el7.noarch
2.卸载旧得软件包
rpm -e yum-utils-1.1.31-54.el7_8.noarch
rpm -e yum-3.4.3-167.el7.centos.noarch --nodeps
rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64
rpm -e yum-plugin-fastestmirror-1.1.31-53.el7.noarch
3.查看自己centos系统版本
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
[root@localhost ~]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=aaf05615b6c91d3cbb076af81aeff531c5d7dfd9, stripped
4.去http://vault.centos.org/官网下载对应的安装包
wget http://vault.centos.org/7.8.2003/os/Source/SPackages/yum-3.4.3-167.el7.centos.src.rpm
wget http://vault.centos.org/7.8.2003/os/Source/SPackages/yum-langpacks-0.4.2-7.el7.src.rpm
wget http://vault.centos.org/7.8.2003/os/Source/SPackages/yum-metadata-parser-1.1.4-10.el7.src.rpm
wget http://vault.centos.org/7.8.2003/os/Source/SPackages/yum-rhn-plugin-2.0.1-10.el7.src.rpm
wget http://vault.centos.org/7.8.2003/os/Source/SPackages/yum-utils-1.1.31-53.el7.src.rpm
wget http://vault.centos.org/7.8.2003/os/Source/SPackages/PackageKit-1.1.10-2.el7.centos.src.rpm