I can't find out which package provides the file
on CentOS 6.
1 Answer
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
-
1
-
1The
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/bin:/root/bin)
I don't believe we can usewhich
to locate it. Andrpm -q --whatprovides "/usr/bin/file"
results inerror: file /usr/bin/file: No such file or directory
.– jwwJul 3, 2016 at 12:40 -
sudo yum install file
.sudo dnf install file
.