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
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop



![RHEL / CentOS Yum Command: Blacklist Packages [ Disable Certain Packages ]](http://s13.cyberciti.org/images/shared/rp/3/30.jpg)









{ 1 comment… read it below or add one }
Your emails with wonderful reminders or tutorials of explanation, are much appreciated.
I have your emails archived with thunderbird and my gmail account.