[root@localhost ~]# rpm -qa | grep yum
[root@localhost ~]# rpm -qa | grep yum | xargs rpm -e --nodeps
[root@localhost ~]# whereis yum yum: /etc/yum [root@localhost ~]# rm -fr /etc/yum
网站地址:http://mirrors.163.com/centos/7/os/x86_64/Packages/
需要下载的yum源链接如下:
(1)wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-cron-3.4.3-167.el7.centos.noarch.rpm
(2)wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
(3)wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm
(4)wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
[root@localhost ~]# rpm -ivh --force --nodeps *.rpm
可查看一下是否安装yum
[root@localhost ~]# rpm -qa |grep yum
[root@localhost ~]# cd /etc/yum.repos.d [root@localhost ~]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@localhost ~]# rm -rf CentOS-Base.repo [root@localhost ~]# mv CentOS7-Base-163.repo CentOS7-Base.repo