Product SiteDocumentation Site

4.2.10.5. Querying for Package Dependencies

A number of tags provide package dependency information. Each of these tags comes in triples, which are formatted similarly. For example, for the capabilities a package requires, you have the REQUIRENAME, REQUIREVERSION, and REQUIREFLAGS tags.
The REQUIRENAME tag holds an array of required capability names. The REQUIREVERSION tag holds an array of the versions of the required capabilities. The REQUIREFLAGS tag ties the two together with a set of bit flags that specify whether the requirement is for a version less than the given number, equal to the given number, greater than or equal to the given number, and so on.
Table 5-4 lists the dependency tags.
Table 5-4 Dependency query tags
Tag
Holds
CONFLICTFLAGS
Array of flags for the capabilities this package conflicts
CONFLICTNAME
Array of capabilities that this package conflicts
CONFLICTVERSION
Array of version numbers that this package conflicts
REQUIREFLAGS
Array of flags for the capabilities this package requires
REQUIRENAME
Array of capabilities that this package requires
REQUIREVERSION
Array of version numbers that this package requires
OBSOLETENAME
Array of capabilities that this package obsoletes
OBSOLETEFLAGS
Array of flags for the capabilities this package obsoletes
OBSOLETEVERSION
Array of version numbers that this package obsoletes
PROVIDENAME
Array of capabilities that this package provides
PROVIDEFLAGS
Array of flags for the capabilities this package provides
PROVIDEVERSION
Array of version numbers that this package provides
Each of these tags is an array. The PROVIDENAME, PROVIDEVERSION, and PROVIDEFLAGS tags work similarly for the capabilities this package provides. The CONFLICTNAME, CONFLICTVERSION, and CONFLICTFLAGS tags specify the conflicts, and, the OBSOLETENAME, OBSOLETEVERSION, and OBSOLETEFLAGS tags specify the obsolete dependencies.
The depflags special-formatting option prints out the flag tags, such as REQUIREFLAGS, in human-readable format. For example, the following command lists the requirements for a package:
$ rpm -q --qf \
"[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" sendmail
rpmlib(VersionedDependencies) <= 3.0.3-1
chkconfig >= 1.3
/usr/sbin/useradd
/bin/mktemp
fileutils
gawk
sed
sh-utils
procmail
bash >= 2.0
/bin/sh
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
For those requirements that have specific version numbers, this command prints out the version number along with the operator, such as >= for a version greater than or equal to the given number.
Note that for many of the requirements, there is no specific version information.
Note
In addition to normal capabilities, most packages will have some RPM-related requirements as well, which specify any required RPM versions, for example, rpmlib(CompressedFileNames).