Solaris 11 package management (IPS) cheatsheet

Install a package called diagnostic/wireshark:
pkg install diagnostic/wireshark
Uninstall a package called diagnostic/wireshark using a short form of the package
name:
pkg uninstall wireshark
Update all possible packages to the newest version, including all Oracle Solaris zones:
pkg update
Do a dry run of an update of all possible packages to the newest version:
pkg update -nv
Update all system packages to the newest version and require a new BE:
pkg update --be-name fix-nfs-issue

List packages currently installed on a system:
pkg list
Show information about an installed package called wireshark:
pkg info wireshark
Show information about an uninstalled package called xchat:
pkg info -r xchat
Show the contents of an installed package called wireshark:
pkg contents wireshark
Show all PNG files of an installed package called wireshark:
pkg contents -o path -a path=*.png wireshark
Search all locally installed packages for the match gcc:
pkg search -l gcc
Search all packages in the configured repositories that contain dev header
gcrypt-module.h:
pkg search 'gcrypt-module.h'
Search for all packages in the configured repositories that have the
classification Web Services/Application and Web Servers:
pkg search -o pkg.name 'set:info.classification:*Application
and Web Servers’
Search for all packages installed locally that have a dependency on
library/libxml2:
pkg search –l -o pkg.name 'depend::library/libxml2'

Browse package command history (includes graphical Package Manager client):
pkg history
Purge package command history:
pkg purge-history
Verify the integrity of the current system image:
pkg verify
Verify the integrity of installed package called wireshark:
pkg verify wireshark
Fix any errors reported by pkg verify on an installed package called wireshark:
pkg fix wireshark
Freeze a package called wireshark to prevent any accidental future updates:
pkg freeze wireshark

List currently associated publishers:
pkg publisher
Add a publisher at a specified repository URI:
pkg set-publisher -p http://www.example.com/solaris11
Add a publisher:
pkg set-publisher -g http://www.example.com/solaris11 siteapps
Remove a publisher:
pkg unset-publisher siteapps
Query a repository URI for publisher names and package counts:
pkgrepo -s http://pkg.oracle.com/solaris/release info
Change to the Oracle Solaris support repository with pre-downloaded certificates
and keys from the Oracle Solaris release repository:
pkg set-publisher -G http://pkg.oracle.com/solaris/release \
-g http://pkg.oracle.com/solaris/support -k /path/to/ssl_key \
-c /path/to/ssl_cert solaris