###这个问题在2010的时候印象比较深!当时也解决了,只是没有记录下来,这次转载人家的,就当留个资料备份吧!
Sometime it happens that when you want do delete/remove a rpm pkg using the command rpm -e pkgname you came across the below error ::
error: "curl-7.15.5-9.el5_7.4" specifies multiple packages
This happens because you have a x86_64 Os installed on your machine and the curl packages of both the architectures, 32 bit and 64 bit are installed on the server ::
rpm -q --queryformat "%{name}.%{arch}\n" curl
curl.i386
curl.x86_64
But by default, Redhat/Fedora/Centos will list the duplicate packages when you query them using RPM. It won’t list the architecture details with the normal query command ::
rpm -qa | grep curl
curl-7.15.5-9.el5_7.4
curl-7.15.5-9.el5_7.4
So, to list the packages along with their architecture’s, you have to use the RPM –queryformat option with the rpm -q command ::
rpm -q --queryformat "%{name}.%{arch}\n" curl
curl.i386
curl.x86_64
And now as can you see the packages with their respective arch(architecture) you can easily delete then using rpm -e pkgname comamnd ::
rpm -e curl.i386
rpm -e curl.x86_64
Or the other alternative to achieve this is that you can use the --allmatches switch with the rpm command : :
rpm -ev --allmatches curl-7.15.5-9.el5_7.4
Now, as you have both the options available to delete an RPM package you can use the one you find more convenient.
或另外一种解决方法:
阅读(1291) | 评论(0) | 转发(0) |