Corrupted rpmdb recovery
Jim Cornette
fc-cornette at insight.rr.com
Wed Feb 8 23:26:16 UTC 2006
Ovidiu Lixandru wrote:
> Jim Cornette wrote:
>
>> If you know what the missing 900 packages are, I believe enabling the
>> 8 repos and choosing install instead of upgrade might be your best
>> answer when going through the list you have. I believe using --force
>> is not needed.
>> Yum is a dep solver and should pull in the missing from the rpm
>> database files again. Ii will not know the packages are not installed
>> so will overwrite your files for non-configuration files. For
>> configuration files, it will make an .rpmnew or similar named file.
>>
>> Looking at /var/log/rpmpkgs the listings are on one line at a time.
>> What you could do is run an rpm -qa |sort >~/my-100.rpms and compare
>> them to the log and manually removing the missed entries or get a diff
>> between the log and the file that you generated and install the
>> differences file feeding it to yum install.
>>
>> This is an idea that I think will work for you. I do not know the
>> specifics if uniq or diff would be your best option to create the
>> missing 900 list. There are some pretty crafty people on the list who
>> could explain how to get you your 900 database entries back if by
>> needing to install alll the packages again, which I'd personally do or
>> to just reclaim the db entries as you suggested. The mirrors might be
>> happier if you could just pull down the rpm database entries again.
>
> Thanks Jim,
> I followed your suggestions and got almost all of the packages back into
> rpmdb. I made a diff between the old rpmpkgs and the almost empty rpmdb,
> edited it and removed the common files, then fed it to yum. The result:
>
> [ovidiu at prometheus ~]$ rpm -qa | wc -l
> 1002
>
> Mission accomplished.
> Thanks again to all.
>
I'm glad that the idea helped you get back the rpm database entries.
Thanks for reporting back. I hope I never have a problem that needs 900
plus entries reclaimed. I'm glad the diff between the two files was the
solution.
Jim
--
If you love someone, set them free.
If they don't come back, then call them up when you're drunk.
More information about the fedora-list
mailing list