System Administration Guide, Volume I

How to Check the Integrity of an Installed Package

  1. Log in to a system as superuser.

  2. Check the status of an installed package with the pkgchk command.


    # pkgchk -a | -c -v pkgid ...
    # pkgchk -d spooldir pkgid ...

    -a

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

    -c

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

    -v

    Specifies verbose mode, which displays file names as pkgchk processes them.

    -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, pkgchk checks all the software packages installed on the system. If omitted, pkgchk displays all available packages.

Example--Checking the Contents of an Installed Package

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


# pkgchk -c SUNWadmfw

If pkgchk determines there are no errors, it returns the system prompt. Otherwise, it reports the error.

Example--Checking the File Attributes of an Installed Package

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


# pkgchk -a SUNWadmfw

If pkgchk determines there are no errors, it returns the system prompt. Otherwise, it reports the error.

Example--Checking Packages Installed in a Spool Directory

The following example shows how to check a software package 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>

Note -

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