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
?
Asked
Active
Viewed 101 times
2

dongle26
- 179
- 1
- 1
- 5
3 Answers
1
sudo yum whatprovides *bin/smbclient

quanta
- 51,413
- 19
- 159
- 217
-
To save a few keystrokes, `yum provides */smbclient` is sufficient. – Michael Hampton Sep 18 '12 at 11:53
1
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)

ewwhite
- 197,159
- 92
- 443
- 809
0
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

golja
- 1,621
- 10
- 14