yum卸载遇到的问题--待解决

系统版本是

[root@master ~]# uname -a 
Linux master 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

本地YUM源文件

[root@master ~]# vim /etc/yum.repos.d/rhel-source.repo 
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///media/cdrom
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-HighAvailable]
name=RHEL-HA
baseurl=file:///media/cdrom/HighAvailability/
enabled=1
gpgcheck=0

安装正常,安装光盘文件正常,卸载报错

[root@master ~]# yum remove -y lrzsz
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.x86_64 0:0.12.20-27.1.el6 will be erased
--> Finished Dependency Resolution
Error: Cannot retrieve repository metadata (repomd.xml) for repository: InstallMedia. Please verify its path and try again
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

使用rpm卸载一样会报错

[root@master ~]# rpm -ivh /media/cdrom/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm 
warning: /media/cdrom/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:lrzsz                  ########################################### [100%]
[root@master ~]# rpm -ef /media/cdrom/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm 
error: package /media/cdrom/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm is not installed
但是直接写命令名可以
[root@master ~]# rpm -ef lrzsz
[root@master ~]# echo $?
0
[root@master ~]# rz
-bash: /usr/bin/rz: No such file or directory

 同样直接卸载命令可以做到

[root@master ~]# rpm -ef httpd 
error: Failed dependencies:
    httpd-mmn = 20051115 is needed by (installed) php-5.3.3-26.el6.x86_64
    httpd is needed by (installed) piranha-0.8.6-4.el6.x86_64
    httpd >= 2.2.0 is needed by (installed) gnome-user-share-2.28.2-3.el6.x86_64
    httpd = 2.2.15-29.el6_4 is needed by (installed) httpd-devel-2.2.15-29.el6_4.x86_64
[root@master ~]# rpm -ef httpd-dvel 
error: package httpd-dvel is not installed
[root@master ~]# rpm -ef httpd-devel 
[root@master ~]# rpm -ef php
error: Failed dependencies:
    php is needed by (installed) piranha-0.8.6-4.el6.x86_64
[root@master ~]# rpm -ef piranha
[root@master ~]# rpm -ef gnome-user-share
[root@master ~]# rpm -ef php
[root@master ~]# /etc/init.d/httpd restart 
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@master ~]# rpm -ef httpd 
warning: /etc/httpd/conf/httpd.conf saved as /etc/httpd/conf/httpd.conf.rpmsave
[root@master ~]# /etc/init.d/httpd restart 
-bash: /etc/init.d/httpd: No such file or directory

暂时没有搞明白这什么状况。

原文地址:https://www.cnblogs.com/zd520pyx1314/p/9157477.html