System Administration Guide: Basic Administration

ProcedureHow to Check the Integrity of Installed Software Packages (pkgchk)

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Check the status of an installed package.

    • To check the file attributes and contents, type the following:


      # pkgchk -a| -c -v pkgid ...
    • To specify the absolute path of the spool directory, type the following:


      # pkgchk -d spooldir pkgid ...
    -a

    Specifies to audit only the file attributes (the permissions), rather than the file attributes and the contents, which is the default.

    -c

    Specifies to audit only the file contents, rather than the file contents and attributes, which is the default.

    -v

    Specifies verbose mode, which displays file names as they are processed.

    -d spooldir

    Specifies the absolute path of the spool directory.

    pkgid

    (Optional) Is the name of one or more packages, separated by spaces. If you do not specify a pkgid, all the software packages installed on the system are checked.


Example 20–14 Checking the Contents of Installed Software Packages

The following example shows how to check the contents of a package.


# pkgchk -c SUNWbash

If no errors occur, the system prompt is returned. Otherwise, the pkgck command reports the error.



Example 20–15 Checking the File Attributes of Installed Software Packages

The following example shows how to check the file attributes of a package.


# pkgchk -a SUNWbash

If no errors occur, the system prompt is returned. Otherwise, the pkgck command reports the error.



Example 20–16 Checking Software Packages Installed in a Spool Directory

The following example shows how to check a software package that was copied to a spool directory (/export/install/packages).


# pkgchk -d /export/install/packages
## checking spooled package <SUNWadmap>
## checking spooled package <SUNWadmfw>
## checking spooled package <SUNWadmc>
## checking spooled package <SUNWsadml>

The checks made on a spooled package are limited because not all information can be audited until a package is installed.