卸載重裝yumnode
操做系統版本:centos7 [root@linux-node3 ~]# uname -r
3.10.0-514.el7.x86_64linux
[root@linux-node3 ~]# rpm -qa yum yum-3.4.3-150.el7.centos.noarch [root@linux-node3 ~]# rpm -qa | grep yum | xargs rpm -e --nodeps #這一步必定要執行,並且要將全部的組件卸載掉,若是卸載不乾淨,後面安裝會有問題 [root@linux-node3 ~]# rpm -qa yum
[root@linux-node3 ~]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm [root@linux-node3 ~]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm [root@linux-node3 ~]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm
備註:若是是centos6,應下載如下rpm包centos
http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
[root@linux-node3 ~]# ls yum-3.4.3-150.el7.centos.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm [root@linux-node3 ~]# rpm -ivh yum-* #安裝 [root@linux-node3 ~]# rpm -qa yum #查看是否已經安裝上 yum-3.4.3-150.el7.centos.noarch.rpm
備註 :測試
不一樣的操做系統版本,要從官網上下載不一樣的rpm包,官網地址」http://mirror.centos.org/centos/「,而後根據本身操做系統的版本選擇便可。centos7
若是出現安裝好之後,yum仍是不能用的狀況,那肯是是原有的yum沒有刪除乾淨,再次執行如下命令,從新安裝yum便可。 rpm -qa|grep yum|xargs rpm -e --nodeps
spa
若是有須要導入證書的狀況,請從官網上找到連接,導入便可 rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
操作系統