Skip Navigation Links | |
Exit Print View | |
Adding and Updating Oracle Solaris 11.1 Software Packages Oracle Solaris 11.1 Information Library |
1. Introduction to the Image Packaging System
2. IPS Graphical User Interfaces
3. Getting Information About Software Packages
Showing Package Install State Information
Displaying Package Descriptions or Licenses
Showing Information from the Package Manifest
Listing Files Installed by a Package
Identifying Which Package Delivers a Specific File
Showing Which Packages Provide Which SMF Services
Listing All Packages in a Group Package
The pkg contents command displays the file system content of packages. With no options or operands, this command displays path information for all packages that are installed in the current image. Use command options to specify particular package content to display. To narrow your results, provide one or more package names. You can use wildcards in the package names. Quote the wildcards so that the argument is passed directly to pkg and the shell does not expand it.
/usr/bin/pkg contents [-Hmr] [-a attribute=pattern ...] [-g path_or_uri ...] [-o attribute ...] [-s sort_key] [-t action_name ...] [pkg_fmri_pattern ...]
Both the contents and search subcommands query the contents of packages. The pkg contents command displays actions and attributes of packages. The pkg search command lists the packages that match the query.
The following example shows the pkg contents default behavior. Use options to specify which actions and attributes to display.
$ pkg contents zip PATH usr usr/bin usr/bin/zip usr/bin/zipcloak usr/bin/zipnote usr/bin/zipsplit usr/share usr/share/man usr/share/man/man1 usr/share/man/man1/zip.1 usr/share/man/man1/zipcloak.1 usr/share/man/man1/zipnote.1 usr/share/man/man1/zipsplit.1
The -m option displays the entire package manifest.
The -r option displays the newest available versions, retrieving information for any packages not currently installed from the repositories of the configured publishers.
Use the -g option to specify the repository or package archive to use as the source of package data for the operation.
Use the -t option to specify the type of actions to display. You can specify multiple types in a comma-separated list, or you can specify the -t option multiple times.
Use the -o option to specify the attributes to display in the output. You can specify multiple attributes in a comma-separated list, or you can specify the -o option multiple times. See the pkg(5) man page for a list of package actions and attributes. In this example, the pkg.size pseudo attribute shows the size of the file; the file action does not have a size attribute. See the pkg(1) man page for a list of pseudo attributes.
Use the -s option to sort actions by the specified action attribute. By default, output is sorted by path or by the first attribute specified by the -o option. The -s option can be specified multiple times.
$ pkg contents -t file -o owner,group,mode,pkg.size,path -s path zip OWNER GROUP MODE PKG.SIZE PATH root bin 0555 228600 usr/bin/zip root bin 0555 107944 usr/bin/zipcloak root bin 0555 101856 usr/bin/zipnote root bin 0555 106252 usr/bin/zipsplit root bin 0444 86036 usr/share/man/man1/zip.1 root bin 0444 2548 usr/share/man/man1/zipcloak.1 root bin 0444 2239 usr/share/man/man1/zipnote.1 root bin 0444 1680 usr/share/man/man1/zipsplit.1
If you view the package manifest, you see that the zip package has twelve file actions. The four that are not shown in the above output are files that cannot be installed in this image. This image is an x86 architecture. The files for the SPARC architecture are not shown. See Controlling Installation of Optional Components for information about variants and facets.
The Oracle Solaris 11 GUI installer installs the solaris-desktop group package. The text installer and the default AI manifest in an Automated Installer installation install the solaris-large-server group package. The default installation manifest for non-global zones installs the solaris-small-server group package. The solaris-small-server group package is also an alternative you can use to install a smaller set of packages on a server. You can use the following command to display the set of packages that is included in each group.
$ pkg contents -Hro fmri -t depend -a type=group solaris-large-server archiver/gnu-tar compress/bzip2 ... text/texinfo web/wget
The -t option matches depend actions in the package. The -a option matches the depend actions that are type group. The -o option displays only the fmri attribute of the group depend action. Recall that group packages do not specify content such as files; group packages specify other packages that are part of the group. See IPS Packages for more information about group packages.
To also show the summary description of each package, use the pkg list -s command:
$ pkg list -Has `pkg contents -Hro fmri -t depend -a type=group solaris-large-server` archiver/gnu-tar GNU version of the tar archiving utility compress/bzip2 high-quality block-sorting file compressor - utilities compress/gzip GNU Zip (gzip) ... text/texinfo Documentation system for on-line information and printed output web/wget wget - GTNU wget
This example displays all the incorporation packages that require you to accept the package license.
$ pkg contents -rt license -a must-accept=true \ -o must-display,license,pkg.name '*incorporation' MUST-DISPLAY LICENSE PKG.NAME true usr/src/pkg.license_files/lic_OTN consolidation/osnet/osnet-incorporation