0

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!

1 Answer 1

0
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.
3
  • yum whatprovides finds the package's name of my existing programs that are already been installed. I'm talking about situations in that I don't have the programs on my *bin/ dir
    – Maor Weiss
    Apr 28, 2022 at 15:07
  • read the man page again.
    – Hani
    Apr 28, 2022 at 15:10
  • Alright! I can see that it does that and finally I've succeeded to work with that. At first, it didn't work. Don't know why, actually. Thank you so much!
    – Maor Weiss
    Apr 28, 2022 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.