Return to Solaris Home Page.

Determine Which Package a Particular File Belongs To - (Sun Solaris)

by Jeff Hunter, Sr. Database Administrator

Use the pkgchk command to determine which package a particular file belongs to. The syntax is:

# /usr/sbin/pkgchk -l -p /absolute/path/todir
For example,
# /usr/sbin/pkgchk -l -p /usr/bin/pgrep
Pathname: /usr/bin/pgrep
Type: regular file
Expected mode: 0555
Expected owner: root
Expected group: bin
Expected file size (bytes): 14688
Expected sum(1) of contents: 63968
Expected last modification: Mar 16 05:53:45 AM 2000
Referenced by the following packages:
Current status: installed

You can also simply query the packages directory as follows:

# grep /usr/bin/pgrep /var/sadm/install/contents
/usr/bin/pgrep f none 0555 root bin 14688 63968 953204025 SUNWcsu

Last modified on: Saturday, 18-Sep-2010 18:23:41 EDT
Page Count: 30785