Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On CentOS, using yum, or another software (text mode). How can I search for a package, for example to search for the package that includes smbclient?

share|improve this question
up vote 1 down vote accepted
sudo yum whatprovides *bin/smbclient
share|improve this answer
To save a few keystrokes, yum provides */smbclient is sufficient. – Michael Hampton Sep 18 '12 at 11:53

You can use yum search TEXT.

You can look at rpm -qf /path/to/file to determine which already-installed package contains a particular file. (or what package said file belongs to)

share|improve this answer

As already mentioned you can use yum whatprovides /path/to/file. That will list all the packages which potentially could provide you the file (installed, updates. base, etc).

However if you would like to find just the current package which provides the file on your system I prefer to use rpm -qf path/to/file, because the result is much clean :)

For example if you use yum for /bin/cp:

# yum whatprovides /bin/cp
Loaded plugins: fastestmirror, refresh-packagekit, security
coreutils-8.4-19.el6.i686 : A set of basic GNU tools commonly used in shell scripts
Repo        : base
Matched from:
Filename    : /bin/cp

coreutils-8.4-16.el6.i686 : A set of basic GNU tools commonly used in shell scripts
Repo        : installed
Matched from:
Other       : Provides-match: /bin/cp

If you use rpm for /bin/cp:

# rpm -qf /bin/cp
share|improve this answer
How do you know the full path of the command if it is not installed? – quanta Sep 18 '12 at 6:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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