I want to know which exact installed package that allows a program to run, I used locate <program_name> command, but that seems to throw all related files a directories that contains that program_name. Is there a better way in Centos8 to list only that package responsible for that program?


Yes, you can find out which package provides a specific binary using rpm -q --whatprovides:

$ rpm -q --whatprovides /usr/bin/ls

To determine the binary providing a given command, use command -v:

$ command -v ls
  • Yes, it does what I need. Thanks – otto_ Jan 12 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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