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

by on November 17, 2012 · 1 comment· LAST UPDATED November 17, 2012

in

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?

Tutorial details
DifficultyEasy (rss)
Root privilegesYes
Requirementsyum command
RHEL/SL/CentOS
Estimated completion timeN/A

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
================================================================================
Installing:
 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
 
Installed:
  yum-utils.noarch 0:1.1.30-14.el6
 
Complete!
 

Syntax

The syntax is:

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

Examples

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

 
repoquery -q -l --plugins htop
 

Sample outputs:

/usr/bin/htop
/usr/share/applications/fedora-htop.desktop
/usr/share/doc/htop-1.0.1
/usr/share/doc/htop-1.0.1/AUTHORS
/usr/share/doc/htop-1.0.1/COPYING
/usr/share/doc/htop-1.0.1/ChangeLog
/usr/share/doc/htop-1.0.1/README
/usr/share/man/man1/htop.1.gz
/usr/share/pixmaps/htop.png

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
 
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 1 comment… read it below or add one }

1 Leslie Satenstein December 16, 2012 at 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.

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , ,

Previous Faq:

Next Faq: