Sometimes you want to know the related package of a file, before installation, or when it is already there. There are several ways to determine the relationships between files and the package they belong to.
For example, let's define what package includes the ping utility.
# yum provides /bin/ping
Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: ftp.nsc.ru * extras: ftp.nsc.ru * updates: ftp.nsc.ru iputils-20160308-8.el7.x86_64 : Network monitoring tools including ping Repo : base Matched from: Filename : /bin/ping iputils-20160308-8.el7.x86_64 : Network monitoring tools including ping Repo : @anaconda Matched from: Filename : /bin/pingor use alternative
# rpm -qf /bin/ping
iputils-20160308-8.el7.x86_64
> zypper se --provides --match-exact /bin/ping
Loading repository data... Reading installed packages... S | Name | Summary | Type --+---------+------------------------------------+-------- i | iputils | IPv4 and IPv6 Networking Utilities | packageor use alternative
> rpm -qf /bin/ping
netcfg-11.5-34.1.noarch
$ dpkg --search /bin/ping
iputils-ping: /bin/ping