Pages

How to take Backup of RPM Database

The RPM database is located in /var/lib/rpm directory. Files in this directory are binary files which hold the installed package information. These files can be backed up safely using tar .Before backing up any file in this directory, confirm that no process is currently using any file within this directory.

# lsof | grep /var/lib/rpm


Remove any stale lock files. Lock files are left behind by processes attempting to access the rpm database. Lock files begin with double underscore character followed by db ( __db )

# rm -f /var/lib/rpm/__db*

Backup the database using tar

# tar czvf  /tmp/rpmdatabase.tar.gz /var/lib/rpm


Backing up the rpm database  before and after package updates  will help to recover the database from a failure 


No comments:

Post a Comment