rpmdb crashed, how to repair? [FC3]

Jim Cornette fc-cornette at insight.rr.com
Sun Feb 5 04:04:00 UTC 2006


Gene Heskett wrote:
> On Saturday 04 February 2006 20:50, Jim Cornette wrote:
>> Danny Terweij - Net Tuning | Net wrote:
>>> Hi there,
>>>
>>> While running a yum update the hdd did get an error and the system
>>> was remounted in read only mode.
>>>
>>> The error seems gone, but the rpmdb is not fine anymore, i did do
>>> rpm --rebuilddb
>>> But now i get weird errors with installing packages, like dupes or
>>> already installed (but it is not).
>>>
>>>
>>> How do i create a new rpmdb with current installed packages?
>>>
>>> Or am i doomed? :)
>>>
>>> Danny
>> Basically, you have to find the multiple version installed rpms and
>> use a option to rpm called --justdb. this option will remove only the
>> database entry for the old nonexistent package entry and then you
>> could use the -V or --verify option to rpm to ensure the later
>> installed version is intact. No output should show on the verify.
>>
>> Someone on the test list posted this one-line command to allow an
>> output to the terminal which will detect multiple entries of
>> packages. The kernel and the gpg-pubkey and any other package that
>> allows for multiple versions to coexist. If you are running a 64-bit
>> system, the command will not work well.
>>
>> rpm -aq --queryformat "%{NAME}\n" | sort | uniq -c | grep -v -E " *1 "
>>
>> For packages that are not actually installed but are in the rpm
>> database, it might be a tougher issue to deal with. You would need to
>> run something like 'rpm -qa |grep missing' as root to detect packages
>> which have missing files. Then you can either download the rpms and
>> use rpm -Uvh --replacefiles --replacepkgs <package.rpm>
>> or remove the database entry for the messed up package and do a 'yum
>> install <package>' on the shortchanged package. Yum should not know it
>> is installed and install over whatever remained of the package.
>>
>> This other suggestions or you're doomed as you stated above. :-)
>>
>> Jim
>>
> Hmm, jumping in here, that command above returns this:
> [root at coyote example]# rpm -aq --queryformat "%{NAME}\n" | sort | uniq 
> -c | grep -v -E " *1 "
>       2 gnome-mag
>       2 gnome-speech
>      28 gpg-pubkey
>       2 kernel
>       2 perl-Digest-HMAC
>       2 perl-Digest-SHA1
>       2 perl-Time-HiRes
> 
> Frankly, with as much stuff as I've built and installed from tarballs, 
> using either the make install or the checkinstall option, I would have 
> thought the output would have been much more verbose. I use kde, self 
> installed, so those gnome entries could probably be removed.  Is there 
> a way to get the versions back from that command automaticly?
> 
>>

There was a script out there that someone made that made a file in the 
/tmp directory, then compared the uniq version and outputted the version 
information for the multiple versions. I long lost the script but it is 
in the archives on the fedora-test-list.
I guess you could add rpm -q on the short list with the packagename 
files. The exact versions should show using the rpm -q function.

I should learn scripting instead of using ready-made scripts. Some day 
maybe.

Jim




More information about the fedora-list mailing list