Which Solaris package installed this file?

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.

In this example we'll use the which command:-

# 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
Current status: installed

From the above output we can confirm that the which command was installed with the package "SUNWcsu".