How to accurately check if package is installed in yum?

Solution 1:

Have you tried this?

$ yum list installed bind

Solution 2:

There's a much easier way of issuing this query: rpm -qa | grep bind or rpm -q bind. The former is best if you're not completely sure of the package name.


Solution 3:

Parsing the results of this command is the most complete answer. You'll need to know the exact package name.

yum info bind

Loaded plugins: refresh-packagekit, rhnplugin
This system is receiving updates from RHN Classic or RHN Satellite.
Installed Packages
Name        : bind
Arch        : x86_64
Epoch       : 32
Version     : 9.8.2
Release     : 0.17.rc1.el6_4.6
Size        : 7.3 M
Repo        : installed
From repo   : rhel-x86_64-workstation-6
Summary     : The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server
URL         : http://www.isc.org/products/BIND/
License     : ISC
Description : BIND (Berkeley Internet Name Domain) is an implementation of the DNS
        : (Domain Name System) protocols. BIND includes a DNS server (named),
        : which resolves host names to IP addresses; a resolver library
        : (routines for applications to use when interfacing with DNS); and
        : tools for verifying that the DNS server is operating properly.