[Yum] Duplicated packages.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 13, 2006 at 10:48:38PM +0300, Panu Matilainen wrote:
> On Tue, 2006-06-13 at 12:31 -0700, Gary Funck wrote:
> > > 
> > > On Tue, 2006-06-13 at 21:20 +0200, Shlomi Levi wrote:
> > > > Hi,
> > > > Somehow I got to the situation that yum reports both
> > > > glibc.i686 2.4-4
> > > > glibc.i686 2.4-8
> > > > As installed on my system. How do I remove the specific 2.4-4 from my
> > > > system?
> > > > Not that important to remove the package as to fix yum's repository.
> > > 
> > > Broken %post/%postun scripts can lead to such situations, eg it's a
> > > packaging problem typically. 'rpm -e glibc-2.4-4' to fix.
> > 
> > My impression is that both an x86 and and x86_64 libraries are installed,
> > and that this is typical of libraries:
> > 
> > % rpm -qa --qf "%{NAME} %{VERSION} %{ARCH}\n" glibc
> > glibc 2.4 x86_64
> > glibc 2.4 i686
> 
> That's an entirely different thing. See above, there are two i686 glibc
> packages with different releases installed in this case. On multilib
> systems such as x86_64 having two packages of same name-ver-rel but
> different arch is business as usual, BUT even then version-release
> should match, having eg
> glibc 2.4-4 i686
> glibc 2.4-8 x86_64
> installed would be an error in practically all cases.

Depending on how the check is done, you might want to exclude the kernel
from this check. I've added that check to my python scripts. They already
do some checks like looking if any package apart from the kernel has
more than one rpm installed per arch and similar checks which could also
point at failed post scripts.
(So the below patch is an addition for "pyrpm.py --checkrpmdb".)

regards,

Florian La Roche



--- oldpyrpm.py 12 Jun 2006 13:33:14 -0000      1.208
+++ oldpyrpm.py 14 Jun 2006 13:14:48 -0000
@@ -5406,6 +5406,7 @@ def readRpmdb(rpmdbpath, distroverpkg, r
     verifyStructure(verbose, packages, triggername, "triggername")
     arch_hash = setMachineDistance(arch)
     checkdupes = {}
+    checkevr = {}
     # Find out "arch", "releasever" and set "checkdupes".
     for pkg in packages.values():
         if rpmdbpath != "/var/lib/rpm" and pkg["name"] in kernelpkgs:
@@ -5421,6 +5422,7 @@ def readRpmdb(rpmdbpath, distroverpkg, r
         if pkg["name"] not in installonlypkgs:
             checkdupes.setdefault("%s.%s" % (pkg["name"], pkg["arch"]),
                 []).append(pkg)
+            checkevr.setdefault("%s" % pkg["name"], []).append(pkg)
     # Check "arch" and dupes:
     for pkg in packages.values():
         if (pkg["name"] != "gpg-pubkey" and
@@ -5434,6 +5436,15 @@ def readRpmdb(rpmdbpath, distroverpkg, r
     for pkg in checkdupes.keys():
         if len(checkdupes[pkg]) > 1:
             print "Warning: more than one package installed for %s." % pkg
+    for pkg in checkevr.keys():
+        if len(checkevr[pkg]) <= 1:
+            continue
+        p = checkevr[pkg][0]
+        evr = (p["epoch"], p["version"], p["release"])
+        for q in checkevr[pkg][1:]:
+            if evr != (q["epoch"], q["version"], q["release"]):
+                print p.getFilename(), "has different epoch/version/release", \
+                    " than", q.getFilename()
     # Read in repositories to compare packages:
     if verbose > 2 and configfiles:
         time3 = time.clock()

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux