Backup CentOS Linux RPM database

by on September 24, 2007 · 0 comments· LAST UPDATED September 24, 2007

in , ,

Q. How do I backup CentOS Linux server RPM database?

A. /var/lib/rpm directory stores all files used by rpm command. All files inside this directory are binary files. It has the information about all installed package. You can easily backup all files using following method.

Backup Linux RPM Database stored at /var/lib/rpm directory

a) Login as the root user.

b) First remove any stale lock file, enter:
/bin/rm -f /var/lib/rpm/__db*

c) The next step is to back up the /var/lib/rpm directory, using tar command:
# tar czvf $(hostname).rpmdatabase.tar.gz /var/lib/rpm
If your hostname is linux-server, it will save backup to a file called linux-server.rpmdatabase.tar.gz

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as: , , , , ,

Previous Faq:

Next Faq: