Old RPM database out of sync with installed packages

Keith Roberts keith at karsites.net
Thu May 19 20:19:14 UTC 2011


On Thu, 19 May 2011, Jeff Johnson wrote:

> To: Keith Roberts <keith at karsites.net>
> From: Jeff Johnson <n3npq at mac.com>
> Subject: Re: Old RPM database out of sync with installed packages
> 
>
> On May 19, 2011, at 2:50 PM, Keith Roberts wrote:
>
>> error: db4 error(-30987) from dbcursor->c_get: DB_PAGE_NOTFOUND: Requested page not found
>
> A Berkeley DB is organized into pages, and the pages are cached
> in /var/lib/rpm/__db* files.
>
> SO nuke those files
> 	rm -f /var/lib/rpm/__db*
> and run "rpm -qa" as root (non-root can't create these files
> and does something different) and the __db* files will be recreated.
>
>> If I do
>>
>> #rpm -vv -Va I get tons of lines like this:
>>
>> D: opening  db index       /var/lib/rpm/Depends create mode=0x0
>> error: rpmdb: damaged header #1222 retrieved -- skipping.
>> error: rpmdb: damaged header #1222 retrieved -- skipping.
>> error: rpmdb: damaged header #1222 retrieved -- skipping.
>> error: rpmdb: damaged header #1222 retrieved -- skipping.
>>
>
> OK, so your backup has a damaged header.
>
> Doing
> 	rpm -qavv
> and then comparing to /var/log/rpmpkgs.* is sometimes enough
> to pin down EXACTLY which package header has gone AWOL. In
> practice, one header lost isn't a big deal, just confusing.
> Eventually some upgrade will take care of re-adding whatever
> header went AWOL and you'll end up with a few orphan files
> left on your file system when a header goes AWOL for whatever reason.
>
> When you are ready (but fix the __db* files first or you will
> really have a mess, but you have backups and so just start over
> from the beginning, no biggie), then doing
> 	rpm --rebuilddb -vv
> will discard any damaged header.
>
>> So shall I run the
>>
>> #rpm --rebuilddb -vv
>>
>> command or not ?
>>
>
> Run when ready and comfortable with what you are seeing.
>
> The worst that happens is that you have to go back to the backups
> and start over. I.e. --rebuildb never changes anything other than
> what is in /var/lib/rpm.

OK, thanks for all your help on this Jeff.

I have a clear run now after deleting those __db.* files.

I have created two text files with the sorted output from 
a rpm -qa run using the old Packages file, and the newer 
one.

Looking at those files with kdiff3, I can see all the 
changes that have been made to the system since January.

I have run the --rebuilddb -vv command, and it appears to 
have worked OK.

Packages that RPM said were not installed (and they are) are 
now reported as being on the system.

It seems like RPM does not touch the filenames of RPM files 
like Filemd5s. That still has the January datestamp on it.

When I do #rpm -Va I now get alot of lines like:

[root at karsites ~]# rpm -Va
prelink: /usr/bin/tclsh8.4: at least one of file's 
dependencies has changed since prelinking
S.?.....    /usr/bin/tclsh8.4
prelink: /usr/lib/libtcl8.4.so: at least one of file's 
dependencies has changed since prelinking
S.?.....    /usr/lib/libtcl8.4.so
prelink: /usr/bin/cdrdao: at least one of file's 
dependencies has changed since prelinking
S.?.....    /usr/bin/cdrdao
prelink: /usr/bin/cue2toc: at least one of file's 
dependencies has changed since prelinking
S.?.....    /usr/bin/cue2toc
prelink: /usr/bin/toc2cddb: at least one of file's 
dependencies has changed since prelinking

Does this matter at all?

Kind Regards,

Keith

-----------------------------------------------------------------
Websites:
http://www.karsites.net
http://www.php-debuggers.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------


More information about the Rpm-list mailing list