What is the purpose of directory "/var/lib/rpm" ?
Environment
- Red Hat Enterprise Linux 5, 6
Issue
- Is it safe to delete the contents of directory "/var/lib/rpm" to free up the disk space?
Resolution
The directory /var/lib/rpm is a RPM database holds information about all the RPM packages installed on the system. This database can be used to query what is installed, to help determine if the latest versions of software in installed, and to verify that the system is properly set up, at least from a packaging point of view.
The RPM database itself is stored in the directory /var/lib/rpm/, and should contain files like the following:
Basenames
Conflictname
__db.001
__db.002
__db.003
Dirnames
Filemd5s
Group
Installtid
Name
Packages
Providename
Provideversion
Pubkeys
Requirename
Requireversion
Sha1header
Sigmd5
Triggername
These files make up the RPM database. The file __db.001 and similar files are lock files used by the RPM system. The other files are databases in Berkeley DB format. The most important file is Packages. The Packages file contains the header tag information for each package indexed by an index number for each package. This number slowly grows with time.
The other files, such as Name, Providename, and Group, exist to speed access to particular types of information. Treat the RPM database with care, back up the files, especially after upgrading, installing, or removing packages.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
