1.1 Identify the component of the Linux distribution that a file belongs to

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.

CentOS 7

# 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/ping
or use alternative
# rpm -qf /bin/ping
  iputils-20160308-8.el7.x86_64

openSUSE Leap 42.3

> zypper se --provides --match-exact /bin/ping
  Loading repository data...
  Reading installed packages...

  S | Name    | Summary                            | Type
  --+---------+------------------------------------+--------
  i | iputils | IPv4 and IPv6 Networking Utilities | package
or use alternative
> rpm -qf /bin/ping
  netcfg-11.5-34.1.noarch

Ubuntu 17.04

$ dpkg --search /bin/ping
  iputils-ping: /bin/ping
Publication/Release Date: Jun 25, 2017
Reviewed: Jun 26, 2017

Advertisement