Home > Mobile >  How to search and install the appropriate package of a software in RHEL distro?
How to search and install the appropriate package of a software in RHEL distro?

Time:04-29

I'll like to know how can I reach the software's package, so I'll know what to install with yum. For example, if I need to use the nslookup command, I need to install the bind-utils package.

Is there a way to find by myself what package needs to be installed?

Thanks in advance!

CodePudding user response:

yum whatprovides

check the man page for yum:

Provides Command Command: provides Aliases: prov, whatprovides, wp

   dnf [options] provides <provide-spec>
          Finds the packages providing the given <provide-spec>.
          This is useful when one knows a filename and wants to find
          what package (installed or not) provides this file.  The
          <provide-spec> is gradually looked for at following
          locations:

          1. The <provide-spec> is matched with all file provides of
             any available package:

                $ dnf provides /usr/bin/gzip
                gzip-1.9-9.fc29.x86_64 : The GNU data compression program
                Matched from:
                Filename    : /usr/bin/gzip

          2. Then all provides of all available packages are
             searched:

                $ dnf provides "gzip(x86-64)"
                gzip-1.9-9.fc29.x86_64 : The GNU data compression program
                Matched from:
                Provide     : gzip(x86-64) = 1.9-9.fc29

          3. DNF assumes that the <provide-spec> is a system
             command, prepends it with /usr/bin/, /usr/sbin/
             prefixes (one at a time) and does the file provides
             search again. For legacy reasons (packages that didn’t
             do UsrMove) also /bin and /sbin prefixes are being
             searched:

                $ dnf provides zless
                gzip-1.9-9.fc29.x86_64 : The GNU data compression program
                Matched from:
                Filename    : /usr/bin/zless

          4. If this last step also fails, DNF returns “Error: No
             Matches found”.

          This command by default does not force a sync of expired
          metadata. See also Metadata Synchronization.
  • Related