There is a package called yum-utils
that builds on YUM and contains a tool called repoquery
that can do this.
$ repoquery --help | grep -E "list files"
-l, --list list files in this package/group
Combined into one example:
$ repoquery -l time
/usr/bin/time
/usr/share/doc/time-1.7
/usr/share/doc/time-1.7/COPYING
/usr/share/doc/time-1.7/NEWS
/usr/share/doc/time-1.7/README
/usr/share/info/time.info.gz
On at least one RH system, with rpm v4.8.0, yum v3.2.29, and repoquery v0.0.11, repoquery -l rpm
prints nothing.
If you are having this issue, try adding the --installed
flag: repoquery --installed -l rpm
.
DNF
Update:
To use dnf
instead of yum-utils
, use the following command:
$ dnf repoquery -l time
/usr/bin/time
/usr/share/doc/time-1.7
/usr/share/doc/time-1.7/COPYING
/usr/share/doc/time-1.7/NEWS
/usr/share/doc/time-1.7/README
/usr/share/info/time.info.gz
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…