Here is a python script that can analyse a rpmdb and also help determining the status of an installed machine:
- /var/lib/rpm/Packages contains all data, the other rpmdb files contain duplicate data for easier access. /var/lib/rpm/Packages is checked against the data in the other files. - rpm header have a sha1 checksum for most of the data. With some nifty lookup you can verify this sha1 sum and thus most of the data to not be corrupted. - A few smaller checks can be done like dependency checking, are packages with an unusual arch installed, which non-kernel packages have more than one package installed etc. - You can choose to check rpmdb against yum repositories to check which installed packages are not included in yum repos or which packages differ in rpmdb. - You can even check rpmdb files from other archs or copy them from some other machine to verify them. All checks work for non-root users.
The python script is available at
http://people.redhat.com/laroche/pyrpm/pyrpm.py
You can call it with:
./pyrpm.py --checkrpmdb
or for the more advanced yum repositories check (you then need urlgrabber and libxml2-python to be installed):
./pyrpm.py -c /etc/yum.conf --checkrpmdb
Let me know if you have questions about this tool, have ideas about further checks that can be added or have problems using it. (Especially if you have real broken rpmdb files on some of your machines, I'd like to hear if some checks could be improved. ;-)
greetings,
Florian La Roche
--On Wednesday, September 07, 2005 12:25 PM +0000 Florian La Roche laroche@redhat.com wrote:
Here is a python script that can analyse a rpmdb and also help determining the status of an installed machine:
Copied to my /usr/local/bin.
Might be good to post this to the RPM dev list.
On Thu, Sep 08, 2005 at 06:18:44AM -0500, Josh Boyer wrote:
On Wed, 2005-09-07 at 12:25 +0000, Florian La Roche wrote:
Here is a python script that can analyse a rpmdb and also help determining the status of an installed machine:
Care to package this up for Extras? :)
This needs some more work before this is ready for a real rpm. Will check if it evolves into that direction.
greetings,
Florian La Roche
Florian La Roche wrote:
On Thu, Sep 08, 2005 at 06:18:44AM -0500, Josh Boyer wrote:
On Wed, 2005-09-07 at 12:25 +0000, Florian La Roche wrote:
Here is a python script that can analyse a rpmdb and also help determining the status of an installed machine:
Care to package this up for Extras? :)
This needs some more work before this is ready for a real rpm. Will check if it evolves into that direction.
http://cvs.fedora.redhat.com/viewcvs/fedora-rpmdevtools/?root=fedora These individual RPM related tools and helpers might be well suited for inclusion into fedora-rpmdevtools?
Warren Togami wtogami@redhat.com
On Wed, Sep 07, 2005 at 12:25:36PM +0000, Florian La Roche wrote:
Here is a python script that can analyse a rpmdb and also help determining the status of an installed machine:
A more complete docu (thanks to asciidoc) for the PyRPM scripts is now available at:
http://people.redhat.com/laroche/pyrpm/
Let me know if you have questions about this tool, have ideas about further checks that can be added or have problems using it. (Especially if you have real broken rpmdb files on some of your machines, I'd like to hear if some checks could be improved. ;-)
The checkrpmdb parts should be fairly well tested by now. Dependency checks and further checks are also added now. See above link for more detailed information.
greetings,
Florian La Roche
devel@lists.stg.fedoraproject.org