Adding and Updating Software in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Viewing Operation History

Use the pkg history command to view pkg command history. By default, the following information is displayed:

  • The start time of the operation

  • The name of the operation, for example, install

  • The client, for example, pkg

  • The outcome of the operation: Succeeded or Failed

Use options to display more information or more precise information.

-l

Display the following information in addition to the default information:

  • The version of the client

  • The name of the user who performed the operation

  • Whether a new BE was created

  • The time the operation completed

  • The complete command that was issued

  • Any errors that were encountered while executing the command

  • Complete FMRIs of changed packages for operations such as update

-n number

Display only the specified number of most recent operations.

$ pkg history -n4
START                    OPERATION                CLIENT             OUTCOME
2013-08-06T16:32:03      fix                      pkg                Succeeded
2013-08-06T16:41:47      revert                   pkg                Succeeded
2013-08-06T17:56:22      set-property             pkg                Succeeded
2013-08-06T17:56:53      unset-property           pkg                Succeeded
-o column[,column]...

Display output using the specified comma-separated list of column names. See the list of column names in pkg(1).

$ pkg history -o start,time,operation,outcome -n4
START                    TIME      OPERATION                OUTCOME
2013-08-06T16:32:03      0:00:27   fix                      Succeeded
2013-08-06T16:41:47      0:00:43   revert                   Succeeded
2013-08-06T17:56:22      0:00:00   set-property             Succeeded
2013-08-06T17:56:53      0:00:00   unset-property           Succeeded 
-t time | time-time[,time | time-time]...

Log records for a comma-separated list of time stamps, formatted with %Y-%m-%dT%H:%M:%S (see the strftime(3C) man page). To specify a range of times, use a hyphen (-) between a start and finish time stamp. The keyword now is an alias for the current time. If the time stamps specified contain duplicate time stamps or overlapping date ranges, only a single instance of each duplicate history event is displayed.

-N

Use the -N option to display any release note text for the operation. The -N option cannot be used with the -o option. If you specify the -v option in an install or update operation in which some of the packages being installed have release notes, the operation output displays the release notes. If the operation installs into a new BE, the operation output provides a path to a release notes file in /tmp in the current BE. When you boot into the new BE, the release notes are in /usr/share/doc/release-notes, or you can use the -N option to view the release notes as shown in the following command:

$ pkg history -N -n 1

If the operation that installed release notes is not the last pkg operation you performed in this BE, use a larger number for the -n argument or use the -t option to identify the pkg operation that installed the release notes as shown in the following command:

$ pkg history -N -t 2013-07-17T08:31:23

Use the pkg purge-history command to delete all command history information.

$ pkg purge-history