OS Component Information

There are several commands used on Solaris for getting information about installed packages. There is also some information which can (must?) be parsed out of files used by the package management system.

General Info on a Package

Use the pkginfo command:

% pkginfo -l SFWgcc              
      NAME:  gcc - GNU Compiler Collection
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  2.95.3,REV=2002.
   BASEDIR:  /opt
    VENDOR:  www.gnu.org
      DESC:  GNU Compiler Collection
    PSTAMP:  freeware20020622002141
  INSTDATE:  Jan 15 2005 08:58
   HOTLINE:  Please contact the owners of this software
    STATUS:  completely installed
     FILES:      324 installed pathnames
                   8 shared pathnames
                   2 linked files
                  19 directories
                  22 executables
               50940 blocks used (approx)

Which Package Owns a File?

Use the pkgchk command to find the package that owns a file:

% pkgchk -l -p /usr/local/bin/gcc
Pathname: /usr/local/bin/gcc
Type: regular file
Expected mode: 0755
Expected owner: root
Expected group: bin
Expected file size (bytes): 604720
Expected sum(1) of contents: 36699
Expected last modification: Sep 05 00:13:07 2006
Referenced by the following packages:
Current status: installed

Package Dependencies

Package dependencies can be found in a file:

% more /var/sadm/pkg/SFWgcc/install/depend 
#       Copyright (c) 1999 Sun Microsystems, Inc.
#       All Rights Reserved
#       @(#)depend      1.2     00/12/01
# This package information file defines software dependencies associated
# with the pkg.  You can define three types of pkg dependencies with this file:
#        P indicates a prerequisite for installation
#        I indicates an incompatible package
#        R indicates a reverse dependency
# <pkg.abbr> see pkginfo(4), PKG parameter
# <name> see pkginfo(4), NAME parameter
# <version> see pkginfo(4), VERSION parameter
# <arch> see pkginfo(4), ARCH parameter
# <type> <pkg.abbr> <name>
#       (<arch>)<version>
#       (<arch>)<version>
#       ...
# <type> <pkg.abbr> <name>
# ...

P SUNWcar       Core Architecture, (Root)
P SUNWkvm       Core Architecture, (Kvm)
P SUNWcsr       Core Solaris, (Root)
P SUNWcsu       Core Solaris, (Usr)
P SUNWcsd       Core Solaris Devices
P SUNWcsl       Core Solaris Libraries
P SFWgcmn       Common GNU package
P SUNWsprot     Solaris Bundled tools
P SUNWarc       Archive Libraries
P SUNWbtool     CCS tools bundled with SunOS
P SUNWhea       SunOS Header Files

Contents of a Package

Finding the list of files in a package seems to require looking in a file:

grep 'SMCgcc$' /var/sadm/install/contents

The format of the entries seems to be related to what's specified in pkgmap(4).