≡ Menu

yum Command: List The Contents (Files) Of A Package

The rpm -qi command list the files of a package. How do I use yum command to list the contents of a package under CentOS or RHEL installed on IBM server hardware?

You can not use yum command for rpm queries. You need to use repoquery command for querying information from yum repositories similarly to rpm queries. This command will work with installed packages as well packages currently not installed on the system.

repoquery command RHEL / CentOS / Fedora Linux installation

Type the following yum command to install yum-utils package:
# yum -y install yum-utils
Sample outputs:

Loaded plugins: product-id, protectbase, rhnplugin, security, subscription-
              : manager
Updating certificate-based repositories.
Unable to read consumer identity
0 packages excluded due to repository protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.30-14.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
 Package        Arch        Version             Repository                 Size
 yum-utils      noarch      1.1.30-14.el6       rhel-x86_64-server-6      101 k
Transaction Summary
Install       1 Package(s)
Total download size: 101 k
Installed size: 0
Downloading Packages:
yum-utils-1.1.30-14.el6.noarch.rpm                       | 101 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : yum-utils-1.1.30-14.el6.noarch                               1/1
Installed products updated.
  Verifying  : yum-utils-1.1.30-14.el6.noarch                               1/1
  yum-utils.noarch 0:1.1.30-14.el6


The syntax is:

repoquery -q -l {package-name-here}
repoquery -q -l --plugins {package-name-here}
repoquery -q -l --plugins *{package-name-here}*


To list the contents of a package called htop using yum, run:

repoquery -q -l --plugins htop

Sample outputs:


To list and match all php packages, enter:

repoquery -q -l --plugins php*

OR (warning may take a long time)

repoquery -q -l --plugins php* | less

{ 2 comments… add one }

  • Leslie Satenstein December 16, 2012, 4:51 pm

    Your emails with wonderful reminders or tutorials of explanation, are much appreciated.
    I have your emails archived with thunderbird and my gmail account.

  • Spencer Williams June 25, 2014, 3:14 pm

    Hey, thanks a lot for this! But say, I don’t think the -q option is necessary, given this description for it in repoquery’s man page:

    -q, –query
    For rpmquery compatibility, doesn’t do anything.

Leave a Comment

   Tagged with: , , , , , , , , , , , ,