Version 1 (modified by skvidal, 7 years ago)
--

YumDB

Since yum 3.2.26 yum has started storing additional information about installed packages in a location outside of the rpmdatabase. None of the information stored there is critical to performing its function but it enhances the user experience and makes it possible to know more about the context in which a package was installed.

Format

the yumdb is a simple flat file database. The filesystem creates a simple tree structure:

   /var/lib/yum/yumdb/
                      p/
                        $checksum-packagename-$ver-$rel.$arch/keyname

Each keyname is a file the contents of which are the values.

Commonly stored information

  • from_repo: the name of the repo from which the pkg was installed
  • reason: reason for installing this pkg (user, dep, etc)
  • command_line: command line used to install this pkg
  • releasever: $releasever of the system at the time the pkg was installed (so you can look for pkgs which have lingered across release updates)

Accessing this information

There is a script called 'yumdb' in yum-utils which allows you to access this information:

  • get the repo from which yum-utils was installed:
           yumdb get from_repo yum-utils
    

  • set a note on the package 'joe'
           yumdb set note "installed by seth b/c he likes it" joe
    

  • Dump out all yumdb values about yum-utils:
           yumdb info yum-utils