If you have a file and need to know the package that installed the file on the system then the following procedure using “pkgchk” should help.
Let’s look at the “which” utility in Solaris and find which package installed the file.
The file path for which is /usr/bin/which
# which which
/usr/bin/which
To find the package which installed it use the “pkgchk” command with the “-l” “and -p” options and the full file path of the file as follows,
# pkgchk -l -p /usr/bin/which
Pathname: /usr/bin/which
Type: regular file
Expected mode: 0555
Expected owner: root
Expected group: bin
Expected file size (bytes): 1288
Expected sum(1) of contents: 25204
Expected last modification: Jan 21 23:32:39 2005
Referenced by the following packages:
SUNWcsu
You can see that the which utility is installed by the package “SUNWcsu”.