duplicate rpm packages

Jeff Johnson n3npq at mac.com
Thu May 24 05:21:36 PDT 2007


Add, say, .i386 to the pkg name and/or --allmatches option to the erase
if you have multiple packages.

FWIW, there is a --dupes option in rpm-4.4.3 and later that can be used
with older rpm, its just a popt alias:

Put this in /etc/popt

rpm     alias --dupes   --qf '%|SOURCERPM?{%{name}.%{arch}}:{%|ARCH?{% 
{name}}:{%{name}-%{version}}|}|\n' --pipe "sort | uniq -d" \
         --POPTdesc=$"list duplicated packages"

and use as rpm -qa --dupes.

73 de Jeff


On May 24, 2007, at 6:25 AM, J.L. Blom wrote:

> I hesitate a little as the problem is already mentioned in other  
> forums
> however without a real solution. But here is the problem.
> In 64-bit systems by what reason several packages are visible in
> duplicate in the rpm database. With a simple script which I will add
> in-line in this message, all duplicate packages can be found (you can
> also see them in e.g. webmin in the package list). They are not
> different packages for different architectures but really duplications
> in the rpm database. If you look it up (using e.g. webmin) the same
> files in the same directories are displayed.
> Using rpm -e is not possible as rpm won't remove it due to the fact  
> that
> it sees it as duplicate packages ( and assumes it is for different
> architectures!):
>
> rpm -e alsa-lib-1.0.13-32.fc5.at error: "alsa-lib-1.0.13-32.fc5.at"
> specifies multiple packages
>
> Does anybody perhaps have a solution?
> Joep
>
> PS: Here is the script (in a bad layout):
>
> #!/bin/bash
> rpm -qa --last >/tmp/timeorderedpackagelist ;olddupes=;  
> allpackages=`rpm -qa --queryformat "%-30{NAME}\n" | sort`;
> baddies="`q= ; for i in $allpackages ; do  if [ "$i" = "$q" ] ;  
> then echo $i ; q=xxx ; else q=$i; fi ; done`";
> baddiesnokernel=`echo "$baddies" | grep -v kernel | grep -v gpg- 
> pubkey`;
> for i in $baddiesnokernel ; do
>     echo $i; grep ^"$i"-[0-9] /tmp/timeorderedpackagelist | cut -d'  
> ' -f1 >/tmp/dupelist;  first=1;
>     for j in `cat /tmp/dupelist` ; do
> 	if [ -z $first ] ; then olddupes="$olddupes $j";  fi;
> 			first=;  done  ;
>     done ;
> echo $olddupes;
>
>




More information about the Smart mailing list