Take the 2-minute tour ×

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

3 Answers 3

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


