[Gllug] Recovering a RH6.2 system with a corrupt RPM database

Xander D Harkness xander at harkness.co.uk
Wed Dec 4 10:35:11 UTC 2002


John Winters wrote:
> On Wed, 2002-12-04 at 09:33, Xander D Harkness wrote:
> 
>>John Winters wrote:
>>
>>>One of my customers has a RH 6.2 system on which the RPM database has
>>>become corrupted.  Each time any reference to the ppp package is
>>>made using the rpm tool, the tool crashes with a segmentation fault.
>>>
>>>That is, if you do an "rpm -qa" you get a listing up to and including
>>>the ppp package, then rpm crashes.  If you do a query on a package
>>>alphabetically before the ppp one it works.  If you do a query on one
>>>alphabetically after it crashes.
>>>
>>>An "rpm --rebuilddb" also crashes with a segmentation fault.
>>>
>>>Is there any way of recovering the system without re-installing?  It's
>>>working fine apart from the corrupt rpm database.
>>>
>>>TIA,
>>>John
>>>
>>>P.S.  The system is patched pretty much up to date, including the the
>>>RPM 4 update.
>>>
>>
>>I had similar problems with a redhat 7.1 machine.  I luckily had another 
>>machine with a sort of similar set up.  I copied /var/lib/rpm from one 
>>to the other and all worked well.  Any chance that you have a similar 
>>machine?
> 
> 
> Yes, I can have.  Did you get long term problems with packages being out
> of step?  (That is, the RPM database thinks a package is installed but
> it isn't, or vice versa.)
I did this about two months ago and the only difficulties are when 
applying security patches.  I use RHN quite extensively as a database to 
check for security patches / bug fixes.  If the machines are listed on 
RHN you can get full package listings from both and correct them using a 
diff.
> 
> Presumably one can use --force to force the system to install a package
> it thinks is already installed.
What I did was to use the --justdb switch, so that you can remove 
packages that are not installed from the database and then reinstall them.
> 
> Does the /var/lib/rpm directory contain *all* the files which rpm
> updates?  In other words, if I save the existing directory and contents
> and then start experimenting with a new one, is there any danger of me
> not being able to get back to the start position?
I *believe* so.  It looks like to only other place that rpm uses is 
/var/spool/repackage.

Kind regards
Xander

rpm -ql rpm
/bin/rpm
/etc/cron.daily/rpm
/etc/logrotate.d/rpm
/etc/rpm
/usr/bin/gendiff
/usr/bin/rpm2cpio
/usr/bin/rpmdb
/usr/bin/rpmquery
/usr/bin/rpmsign
/usr/bin/rpmverify
/usr/lib/librpm-4.1.so
/usr/lib/librpmbuild-4.1.so
/usr/lib/librpmdb-4.1.so
/usr/lib/librpmio-4.1.so
/usr/lib/rpm
/usr/lib/rpm/athlon-linux
/usr/lib/rpm/athlon-linux/macros
/usr/lib/rpm/config.guess
/usr/lib/rpm/config.sub
/usr/lib/rpm/convertrpmrc.sh
/usr/lib/rpm/i386-linux
/usr/lib/rpm/i386-linux/macros
/usr/lib/rpm/i486-linux
/usr/lib/rpm/i486-linux/macros
/usr/lib/rpm/i586-linux
/usr/lib/rpm/i586-linux/macros
/usr/lib/rpm/i686-linux
/usr/lib/rpm/i686-linux/macros
/usr/lib/rpm/macros
/usr/lib/rpm/mkinstalldirs
/usr/lib/rpm/noarch-linux
/usr/lib/rpm/noarch-linux/macros
/usr/lib/rpm/rpm.daily
/usr/lib/rpm/rpm.log
/usr/lib/rpm/rpm.xinetd
/usr/lib/rpm/rpm2cpio.sh
/usr/lib/rpm/rpmd
/usr/lib/rpm/rpme
/usr/lib/rpm/rpmi
/usr/lib/rpm/rpmk
/usr/lib/rpm/rpmpopt-4.1
/usr/lib/rpm/rpmq
/usr/lib/rpm/rpmrc
/usr/lib/rpm/rpmu
/usr/lib/rpm/rpmv
/usr/lib/rpm/tgpg
/usr/share/doc/rpm-4.1
/usr/share/doc/rpm-4.1/CHANGES
/usr/share/doc/rpm-4.1/GROUPS
/usr/share/doc/rpm-4.1/Makefile
/usr/share/doc/rpm-4.1/Makefile.am
/usr/share/doc/rpm-4.1/Makefile.in
/usr/share/doc/rpm-4.1/RPM-GPG-KEY
/usr/share/doc/rpm-4.1/RPM-PGP-KEY
/usr/share/doc/rpm-4.1/builddependencies
/usr/share/doc/rpm-4.1/buildroot
/usr/share/doc/rpm-4.1/conditionalbuilds
/usr/share/doc/rpm-4.1/dependencies
/usr/share/doc/rpm-4.1/format
/usr/share/doc/rpm-4.1/hregions
/usr/share/doc/rpm-4.1/macros
/usr/share/doc/rpm-4.1/multiplebuilds
/usr/share/doc/rpm-4.1/queryformat
/usr/share/doc/rpm-4.1/relocatable
/usr/share/doc/rpm-4.1/rollbacks
/usr/share/doc/rpm-4.1/signatures
/usr/share/doc/rpm-4.1/spec
/usr/share/doc/rpm-4.1/triggers
/usr/share/doc/rpm-4.1/tsort
/usr/share/locale/cs/LC_MESSAGES/rpm.mo
/usr/share/locale/da/LC_MESSAGES/rpm.mo
/usr/share/locale/de/LC_MESSAGES/rpm.mo
/usr/share/locale/fi/LC_MESSAGES/rpm.mo
/usr/share/locale/fr/LC_MESSAGES/rpm.mo
/usr/share/locale/is/LC_MESSAGES/rpm.mo
/usr/share/locale/ja/LC_MESSAGES/rpm.mo
/usr/share/locale/ko/LC_MESSAGES/rpm.mo
/usr/share/locale/no/LC_MESSAGES/rpm.mo
/usr/share/locale/pl/LC_MESSAGES/rpm.mo
/usr/share/locale/pt/LC_MESSAGES/rpm.mo
/usr/share/locale/pt_BR/LC_MESSAGES/rpm.mo
/usr/share/locale/ro/LC_MESSAGES/rpm.mo
/usr/share/locale/ru/LC_MESSAGES/rpm.mo
/usr/share/locale/sk/LC_MESSAGES/rpm.mo
/usr/share/locale/sl/LC_MESSAGES/rpm.mo
/usr/share/locale/sr/LC_MESSAGES/rpm.mo
/usr/share/locale/sv/LC_MESSAGES/rpm.mo
/usr/share/locale/tr/LC_MESSAGES/rpm.mo
/usr/share/man/ja/man8/rpm.8.gz
/usr/share/man/ja/man8/rpm2cpio.8.gz
/usr/share/man/man1/gendiff.1.gz
/usr/share/man/man8/rpm.8.gz
/usr/share/man/man8/rpm2cpio.8.gz
/usr/share/man/pl/man8/rpm.8.gz
/usr/share/man/pl/man8/rpm2cpio.8.gz
/usr/share/man/ru/man8/rpm.8.gz
/usr/share/man/ru/man8/rpm2cpio.8.gz
/usr/share/man/sk/man8/rpm.8.gz
/var/lib/rpm
/var/spool/repackage

> 
> John
> 


-- 
Why did the Roman Empire collapse?  What is the Latin for office automation?


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list