rpm --rebuild: what does it do?
Stuart McGraw
smcg4191 at frii.com
Sat Mar 20 02:25:43 UTC 2010
On 03/19/2010 02:29 PM, Aaron Konstam wrote:
> On Fri, 2010-03-19 at 14:03 -0600, Stuart McGraw wrote:
>> Hello all,
>>
>> The man page for "rpm --rebuild", with rather excessive
>> terseness, says:
>>
>> > [...] use --rebuilddb to rebuild the database indices
>> > from the installed package headers.
>>
>> I want to backup the "rpm database". Presumably I
>> do not need to backup the "database indices" since
>> they are recreated by rpm --rebuild.
>>
>> Can some translate "rpm database" and "database indices"
>> into filenames? Thanks.
>>
>> [P.S., I quickly scanned the Max RPM book, especially
>> chapters 6 and 7 and did not find an answer there though
>> it is a long book and I may have missed it.]
>
> I thought the answer was simple. The rpm databases are named:
> /var/lib/rpm/__db.00x where x =1,2,3,4
>
> However I notice there are other files called:
> /var/lib/rpmrebuilddb.2702/__db.00x where x=1,2,3
>
> I have never seen them before but they seem to be related to rpm
> --rebuilddb
I think those are left over from a failed/interrupted/partial
rebuild. When I do a rebuild with -vv here, the last command
shown is "D: removing directory /var/lib/rpmrebuilddb.9081"
I did an experiment (actually quite a few but what they
led to was):
mkdir /tmp/foo
rm /tmp/foo/*
rpm --dbpath /tmp/foo --initdb
cp -p /var/lib/rpm/__db* /tmp/foo
rpm --dbpath /tmp/foo --rebuilddb
# All the files in /var/lib/rpm/ are now in /tmp/foo/ but are smaller.
# The __db* files now have current time, not time they had in /var/lib/rpm/.
rpm --dbpath /tmp/foo --verify coreutils
# <reports that coreutils is not installed>
rm /tmp/foo/*
rpm --dbpath /tmp/foo --initdb
cp -p /var/lib/rpm/Packages /tmp/foo
rpm --dbpath /tmp/foo --rebuilddb
# Above comand takes long time. Sizes of files in /tmp/foo/ now same
# or close to size of files in /var/lib/rpm/. Time of Packages file
# unchanged from /var/lib/rpm/.
rpm --dbpath /tmp/foo --verify coreutils
# <reports coreutils is ok>
>From this is seems like /var/lib/rpm/Packages is *the*
database. But I would still appreciate confirmation
from someone.
More information about the users
mailing list