File command Linux package name

8,167

If you had file installed on one of your systems, than the following command would have answered your question

 rpm -q --whatprovides `which file`

In CentOS and other RedHat derived distributions the name of the package is file

 $ rpm -q --whatprovides `which file`
 file-5.04-13.el6.x86_64

Edit 2 (after a comment from jww)

To install file type

 sudo yum install file

Edit 1 As @Miquel reminds in Debian and Ubuntu one can use dpkg-query -S:

 $ dpkg-query -S `which file`
 file: /usr/bin/file
Share:
8,167

Related videos on Youtube

Kalle Richter
Author by

Kalle Richter

Updated on September 18, 2022

Comments

  • Kalle Richter
    Kalle Richter over 1 year

    I can't find out which package provides the file on CentOS 6.

    • jww
      jww almost 8 years
      Try sudo yum install file.
  • Miquel
    Miquel almost 12 years
    Replace rpm -q with dpkg -S in debian/ubuntu/derivates
  • jww
    jww almost 8 years
    The file progam is missing on CentOS 6 and 7: /usr/bin/which: no file in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bi‌​n:/root/bin) I don't believe we can use which to locate it. And rpm -q --whatprovides "/usr/bin/file" results in error: file /usr/bin/file: No such file or directory.
  • humble
    humble almost 8 years
    @jww edited the post