duplicate packages after up2date failure

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

 



We were taking advantage of the weekend to update our RHEL4.1 machine to
RHEL4.2.  It is worth mentioning that it is an x86_64 box.  While
running up2date, it hung on one of the packages.  There was a useradd
process sucking 99% of the CPU that couldn't be killed or traced.  (It
ignored sigKILL and sigSTOP, was not a zombie or in iowait, and
[sl]trace just hung with no output (and required a kill -9) on it.
Killing its parent just got it adopted by init, with no change in
behavior.  Bug report against shadow-utils has been filed [1] though I
believe that an unkillable process that uses CPU is an indication of a
problem in the kernel.

Anyway, at least a reboot fixed that.  But the damage was much worse:
our RPM database appears to be mangled quite badly, and the standard
trick of rm /var/lib/rpm/__db.00[1-3] && rpm --rebuilddb doesn't help.
In particular, the RPM database now thinks that we have *both* the old
and new versions of several RPMs installed.  For example:

# rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE} %{ARCH}\n" rpm
rpm-4.3.3-9_nonptl x86_64
rpm-4.3.3-11_nonptl x86_64

We have 164 packages which are duplicated in this fashion.  Meanwhile
up2date wants to update them (since we have the old version) but can't
(because we have the new version).  So... I'm looking for advice on how
to handle this.

My guess is that the cleanest thing to do is remove the newer of each
pair from the database and then run up2date, which should upgrade
everything (fixing any old files on disk).  My proposed script for doing
this is:

for file in `rpm -qa --queryformat="%{NAME} %{ARCH}\n" | sort | uniq -c | grep -v "   1 " | cut -c 9- | cut -d" " -f1`; do rpm -q --last $file | head -1 | cut -d" " -f1; done | xargs rpm -e --justdb
up2date -p
up2date

Does this look reasonable to everyone, or is there a better way to
handle this problem?

Many thanks in advance for any advice,

Damian Menscher

[1] https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=170087
--
-=#| Physics Grad Student & SysAdmin @ U Illinois Urbana-Champaign |#=-
-=#| 488 LLP, 1110 W. Green St, Urbana, IL 61801 Ofc:(217)333-0038 |#=-
-=#| 4602 Beckman, VMIL/MS, Imaging Technology Group:(217)244-3074 |#=-
-=#| <menscher@xxxxxxxx> www.uiuc.edu/~menscher/ Fax:(217)333-9819 |#=-
-=#| The above opinions are not necessarily those of my employers. |#=-


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux