系统环境:
物理机:Windows 10 家庭中文版
虚拟机:VMware Workstation 10
Linux发行版本:CentOS 6.5
相关信息查询:
首先查询,系统安装的yum包的信息:
~]# rpm -q yum
yum-3.2.29-40.el6.centos.noarch
执行卸载yum操作:
~]# rpm -e yum-3.2.29-40.el6.centos.noarch
error: Failed dependencies:
yum >= 3.0 is needed by (installed) yum-plugin-fastestmirror-1.1.30-14.el6.noarch
故,同时卸载"yum-3.2.29-40.el6.centos.noarch"和"yum-plugin-fastestmirror-1.1.30-14.el6.noarch":
~]# rpm -e "yum-3.2.29-40.el6.centos.noarch" "yum-plugin-fastestmirror-1.1.30-14.el6.noarch"
确认yum已经卸载:
~]# rpm -q yum
package yum is not installed
下面开始修复之旅:
因为系统当初安装的时候,是通过加载光盘镜像安装的,所以安装yum所需要的rpm包,在光盘镜像中肯定可以找到:
~]# mount -r /dev/cdrom /media/cdrom/
~]# cd /media/cdrom/Packages/
~]# ls | grep -E "yum-3.2.29|yum-plugin-fastestmirror"
yum-3.2.29-40.el6.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
#至此顺利找到了安装yum所需要的rpm包
#下面执行安装:
~]# rpm -ivh "yum-3.2.29-40.el6.centos.noarch.rpm" "yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm"
#查询yum安装情况:
~]# rpm -q yum
yum-3.2.29-40.el6.centos.noarch