Main Menu

Search

LINUX: YUM Command To Check Which Package a Partcular File Belongs To (How To Doc)

Below yum command can be used to check which package a particular file belongs to.
yum --disablerepo=* whatprovides <filename>

As an example if you want to check what package /etc/hosts file belongs to, below command can be executed.
yum --disablerepo=* whatprovides /etc/passwd

Below is example output of above command. As we can see /etc/passwd file belongs to setup-2.8.14-23.el6.noarch package.

# yum --disablerepo=* whatprovides /etc/passwd
Loaded plugins: security, ulninfo
setup-2.8.14-23.el6.noarch : A set of system configuration and setup files
Repo        : installed
Matched from:
Other       : Provides-match: /etc/passwd

Products to which Article Applies

All Linux Operating Systems

Additional Reference

https://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/





tarun boyella

No comments:

Post a Comment