The Computer Oracle

How to find which package certain command belongs to on CentOS?

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Take control of your privacy with Proton's trusted, Swiss-based, secure services.
Choose what you need and safeguard your digital life:
Mail: https://go.getproton.me/SH1CU
VPN: https://go.getproton.me/SH1DI
Password Manager: https://go.getproton.me/SH1DJ
Drive: https://go.getproton.me/SH1CT


Music by Eric Matyas
https://www.soundimage.org
Track title: Cool Puzzler LoFi

--

Chapters
00:00 How To Find Which Package Certain Command Belongs To On Centos?
00:40 Accepted Answer Score 19
00:48 Answer 2 Score 29
00:59 Answer 3 Score 11
01:17 Answer 4 Score 1
01:30 Thank you

--

Full question
https://superuser.com/questions/467186/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #commandline #centos #packagemanagement

#avk47



ANSWER 1

Score 29


Ubuntu / Debian example to check the package of the free command:

dpkg -S $(which free)



ACCEPTED ANSWER

Score 19


Query the rpmdb.

rpm -qf $(which free)



ANSWER 3

Score 11


For CentOS, how about yum provides?

Use

which free 

to find out where it is

For me it's at

/usr/bin/free

So then you can run

yum provides /usr/bin/free

and it will tell you which package has it




ANSWER 4

Score 1


For all red-hat based distributions you can use yum package management utility

yum provides `which free`

provides argument specifies which package provides certain feature or file.