Use the pkg history command to view pkg command history that modifies the image. Commands such as pkg search, pkg refresh, pkg publisher, pkg facet, and pkg property are not recorded in pkg history, but commands such as pkg set-publisher, pkg change-facet, and pkg set-property are recorded in pkg history. Sometimes pkg history shows multiple operations executed for one command entered. For example, pkg refresh --full displays refresh-publishers and rebuild-image-catalogs in pkg history output.
By default, the pkg history command displays the following information:
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.
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
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
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
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.
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
The following command shows pkg operations that occurred within a specified range of time:
$ pkg history -t 2016-07-22T10:54:00-2016-07-22T10:55:00 START OPERATION CLIENT OUTCOME 2016-07-22T10:54:05 update-publisher pkg Succeeded 2016-07-22T10:54:06 refresh-publishers pkg Succeeded 2016-07-22T10:54:53 rebuild-image-catalogs pkg Succeeded
The following command shows more information about a particular operation from the preceding list:
$ pkg history -lt 2016-07-22T10:54:05 Operation: update-publisher Outcome: Succeeded Reason: None Client: pkg Version: 77d785eb851b User: admin (100) Boot Env.: 103_104.34291 Boot Env. UUID: 1831b116-361f-4ef0-9406-851c446ec4c2 New Boot Env.: None New Boot Env. UUID: (None) Snapshot: (None) Start Time: 2016-07-22T10:54:05 End Time: 2016-07-22T10:55:25 Total Time: 0:01:20 Command: /usr/bin/pkg set-publisher -g /var/share/pkg/repositories/solaris solaris Release Notes: No Start State: None End State: NoneExample 26 Purging History Information
Use the pkg purge-history command to delete all existing history information.
$ pkg purge-history