Bug 141552 - FC2 -> FC3 upgrade, massive package doubling, no easy way to remove
FC2 -> FC3 upgrade, massive package doubling, no easy way to remove
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2004-12-01 18:02 EST by Adam Wiggins
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-12-01 19:26:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Adam Wiggins 2004-12-01 18:02:09 EST
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 
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-01 19:26:46 EST
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 17:13:15 EST
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.

Note You need to log in before you can comment on or make changes to this bug.