Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

3 Answers

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
add comment

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
add comment

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
coreutils-8.4-16.el6.i686
share|improve this answer
1  
How do you know the full path of the command if it is not installed? –  quanta Sep 18 '12 at 6:08
add comment

Your Answer

 
discard

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.