Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2809171
  • 博文数量: 587
  • 博客积分: 6356
  • 博客等级: 准将
  • 技术积分: 6410
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-23 10:54
个人简介

器量大者,福泽必厚

文章分类

全部博文(587)

文章存档

2019年(3)

2018年(1)

2017年(29)

2016年(39)

2015年(66)

2014年(117)

2013年(136)

2012年(58)

2011年(34)

2010年(50)

2009年(38)

2008年(16)

分类: LINUX

2014-12-13 14:48:18

###这个问题在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) |
给主人留下些什么吧!~~