Bug 141552

Summary: FC2 -> FC3 upgrade, massive package doubling, no easy way to remove
Product: [Fedora] Fedora Reporter: Adam Wiggins <hiro>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: nobody+pnasrat
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-12-02 00:26:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Wiggins 2004-12-01 23:02:09 UTC
I upgraded my FC2 machine to FC3 using the DVD ISO.  The upgrade went 
flawlessly, with one exception: there is massive amounts of package 
doubling in my rpm database.  Looks like just about every major 
pacakages has two of the exact same version installed, i.e.: 
 
[adam@onyx ~]$ rpm -q esound 
esound-0.2.35-2 
esound-0.2.35-2 
 
Since they are the exact same version I cannot uninstall the second 
one by name.  There's --allmatches, but that would uninstall both 
versions - completely infeasible, since lots of core stuff (GNOME 
libraries, xorg packages, etc) are doubled. 
 
It really seems like rpm should: 
 
1. Make it impossible to have two of the _exact_ same package version 
installed; perhaps --rebuilddb could just remove the reference to any 
doubled packages; and 
 
2. At worst, provide some option for removing all but one of a 
package.  Actually, this would be useful even in non-doubling 
situations: a command like "rpm -e --except-latest esound" which 
removed all but the latest version would be useful in lots of cases.  
In the case of doubled packages, it would remove all but one. 
 
I've run into doubled packages in the rpm database a number of times 
over the years.  In one case someone who was a Linux newbie found 
themselves screwed because they had somehow managed to install an rpm 
five or six times, but trying to remove it didn't work because of the 
"specifies multiple packages" problem.  It doesn't seem like a 
beginner should be able to get the rpm database into what is 
basically a corrupted state by something as simple as installing a 
single package.

Comment 1 Jeff Johnson 2004-12-02 00:26:46 UTC
Unfortunately, there are cases where identical NEVR *do* make
sense, multilib (i.e. elf32/elf64 arches) and --relocate being
only two cases. But yes, many users use --install, when --update
should have been used.

Easiest way to get rid of doubling is to do
    rpm -qa --last > /tmp/list
then edit list down to those N-V-R packages that you don't
want, then do
    rpm -e `cat /tmp/list`

It would not be impossible to script the mess and add --except-latest
as a popt exec, the --last option is actually a script disguised
as an option, see /usr/lib/rpm/rpmpopt* for details.

There's also ways to remove duplicated entries during
a --rebuilddb, but that doesn't clean up what's on the
file system, only entries in the rpmdb, and so not recommended.

Adding --allmatches is the answer to the other complaint, ironically
an attempt to prevent accidents by newbies.

There's no pleasing everyone.

Comment 2 Paul Nasrat 2004-12-02 22:13:15 UTC
Also you can do:

rpm --qf '%{name}-%{version}-%{release}.%{arch}' -qf esound

Probaby x86_64 and i386 installed

rpm -e esound.i386 should work as desired.