Go to main content

Updating Systems and Adding Software in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020

Showing Information From the Package Manifest

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.

Both the contents and search subcommands query the content of packages. The pkg contents command displays actions and attributes of packages. The pkg search command lists the packages that match the query. See also Comparing the pkg search and pkg contents Commands.

Listing Files Installed by a Package

The following example shows the default behavior of the pkg contents command: Display the value of the path attribute for each file system object that can be installed in this image.

$ pkg contents amp
pkg: This package delivers no filesystem content, but may contain metadata. Use
the -o option to specify fields other than 'path', or use the -m option to show
the raw package manifests.
$ pkg contents zip

The pkg contents command displays only content that can be installed in this image. If you view the package manifest (use the -m option), you see that the zip package has 12 file actions. The four files that are not shown in this output are files that cannot be installed in this image. This image is an x86 architecture. The files that are not shown are the four /usr/bin files for the SPARC architecture. See Controlling Installation of Optional Components for information about variants and facets.

Displaying Information that is not a Path

To display information that is not a path or to display a subset of path information, use the -t, -a, and -o options of the pkg contents command.

The -t option specifies the type of action to select, such as file, link, or depend. See the pkg(7) man page for a list of package actions. You can specify multiple action types in a comma-separated list, or you can specify the -t option multiple times. When you use the -t option, the default output are the values of the key attributes for that action.

The -a option specifies which attribute values of the action to select. See the pkg(7) man page for a list of attributes of each action type. You can specify the -a option multiple times.

The -o option specifies the output to display. You can specify the name of an attribute as described for the -a option or any of several pseudo attribute names listed in the pkg(1) man page. You can specify multiple attribute arguments in a comma-separated list, or you can specify the -o option multiple times. Each -o argument is one column of output.

Example 1  Displaying Attributes of Files Installed by a Package

This example displays additional attributes of the paths listed in the example in Listing Files Installed by a Package.

$ pkg contents -o owner,group,mode,path zip
root  bin   0555 usr/bin/zip
root  bin   0555 usr/bin/zipcloak
root  bin   0555 usr/bin/zipnote
root  bin   0555 usr/bin/zipsplit
root  bin   0444 usr/share/man/man1/zip.1
root  bin   0444 usr/share/man/man1/zipcloak.1
root  bin   0444 usr/share/man/man1/zipnote.1
root  bin   0444 usr/share/man/man1/zipsplit.1

The default output displayed if the -o option is not specified is values of path attributes. The following output shows that the oracle-rdbms-server-18c-preinstall package does not deliver any files, links, or directories directly.

$ pkg contents -r oracle-rdbms-server-18c-preinstall
pkg: This package delivers no filesystem content, but may contain metadata. Use
the -o option to specify fields other than 'path', or use the -m option to show
the raw package manifests.

All of the following commands show that the oracle-rdbms-server-12-1-preinstall package has set, signature, and depend actions:

$ pkg contents -rm oracle-rdbms-server-18c-preinstall
$ pkg contents -ro action.name oracle-rdbms-server-18c-preinstall
$ pkg contents -ro action.raw oracle-rdbms-server-18c-preinstall
Example 2  Specifying an Action Type

The following command displays the dependency type and package name of each dependency in the oracle-rdbms-server-18c-preinstall package:

$ pkg contents -rt depend oracle-rdbms-server-18c-preinstall
group   system/header
group   system/kernel/oracka
group   system/picl
group   x11/diagnostic/x11-info-clients
group   x11/library/libxi
group   x11/library/libxtst
group   x11/session/xauth
require compress/unzip
require developer/assembler
require developer/build/make
require system/dtrace
require system/library/openmp
Example 3  Specifying Action Attributes

If you are only interested in some of the dependencies, use the -a option to narrow the selection.

$ pkg contents -rt depend -a fmri='*lib*' oracle-rdbms-server-18c-preinstall
group   x11/library/libxi
group   x11/library/libxtst
require system/library/openmp

By default, output is sorted by path or by the first attribute specified by the -o option. You can use the -s option to specify a different attribute as the sort key. The -s option can be specified multiple times.

In the following command, the specified attributes are unique to the set action, and you do not need to specify the set action type:

$ pkg contents -ra name=pkg.summary -a name=pkg.description -o name,value -s value oracle-rdbms-server-18c-preinstall
NAME            VALUE
pkg.summary     Prerequisite package for Oracle Database 18c
pkg.description Provides the set of Oracle Solaris packages required for installation and operation of Oracle Database 18c.

If you do specify the set action type, then you do not need to specify the output columns because name and value are the default output for set actions:

$ pkg contents -rt set -a name=pkg.summary -a name=pkg.description -s value oracle-rdbms-server-18c-preinstall
Example 4  Displaying All Links Involved in a Mediation

The following command shows the path and target of links that participate in the python mediation delivered by the python-35 package. See Specifying a Default Application Implementation for information about mediations of multiple versions.

$ pkg contents -a mediator=python -o path,target python-35
PATH                                 TARGET
usr/bin/2to3                         2to3-3.5
usr/bin/idle                         idle3.5
usr/bin/pydoc                        pydoc3.5
usr/bin/python                       python3.5
usr/bin/python-config                python3.5-config
usr/bin/pyvenv                       pyvenv-3.5
usr/lib/pkgconfig/python3.pc         python-3.5.pc
usr/lib/sparcv9/pkgconfig/python3.pc python-3.5.pc
usr/share/man/man1/python3.1         python3.5.1
Example 5  Displaying Other File System Objects and Attributes

The following example shows the path and target of links installed by the specified packages. In addition to the attributes shown in the pkg(7) man page, several pseudo attributes are available to use. See the pkg(1) man page for a list of pseudo attributes.

In the following example, the pkg.name pseudo attribute shows the name of the package that delivers the specified action. In this example, Python 2.7.14, Python 3.4.6, and Python 3.5.3 are installed, and the command shows the path to use to access the specific version if you do not want to rely on the /usr/bin/python link. See also Specifying a Default Application Implementation for information about mediations of multiple versions.

$ pkg contents -t link -a path=usr/bin/python -o path,target,pkg.name
usr/bin/python python2.7 runtime/python-27
usr/bin/python python3.4 runtime/python-34
usr/bin/python python3.5 runtime/python-35

Listing All Installable Packages in a Group Package

Oracle Solaris provides several system installation group packages. 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-minimal-server group package installs the minimal supported set of packages required to run Oracle Solaris.

You can use the following command to display the set of packages that is included in the specified group package.

Note -  This package list does not include every package that is installed when you install the group package. Dependencies of the packages in this list will also be installed, and dependencies of those dependencies.
$ pkg contents -rt depend solaris-minimal-server
group   network/ping
group   network/ssh
group   service/network/ssh
group   shell/tcsh
group   shell/zsh
group   system/network
group   system/rsyslog
require developer/debug/mdb
require editor/vim/vim-core
require group/system/solaris-core-platform
require package/pkg
require release/name
require release/notices
require shell/bash
require shell/ksh93
require system/core-os
require system/library/platform

The -t option matches depend actions in the package. You can avoid installing packages that are group type dependencies. See Avoiding Installing Some Packages in a Group Package. Recall that group packages do not specify file system content; group packages specify other packages that are part of the group. See Group Packages for more information about group packages.

To also show the summary description of each package, use the pkg list -s command. The -o fmri option of the pkg contents command limits the output to what is shown in the second column in the previous example.

$ pkg list -Has `pkg contents -Hro fmri -t depend solaris-minimal-server`
developer/debug/mdb                 Modular Debugger (MDB)
editor/vim/vim-core                 Vi IMproved (core executables)
group/system/solaris-core-platform  Oracle Solaris Core Platform
network/ping                        Ping command
network/ssh                         OpenSSH client and associated utilities
package/pkg                         Image Packaging System
release/name                        Solaris Naming Enabler
release/notices                     Oracle Solaris notices
service/network/ssh                 OpenSSH servers and SSH (Secure Shell) services
shell/bash                          GNU Bourne-Again shell (bash)
shell/ksh93                         Ksh93 - The AT&T Korn Shell
shell/tcsh                          Tenex C-shell (tcsh)
shell/zsh                           Z Shell (zsh)
system/core-os                      Core Solaris
system/library/platform             Core Architecture, (Kvm)
system/network                      Core Network Infrastructure
system/rsyslog                      reliable and extended syslogd

Man pages are installed by default when the software they document is installed. However, the solaris-minimal-server installation group does not install the man command. If you install the solaris-minimal-server group, you might want to do one of the following:

  • Set the doc.man facet to false to avoid installing the man pages. See Showing and Changing Facet Values.

  • Install the text/doctools package to install the man command.

Displaying License Requirements

The following example displays all packages that require you to accept the package license:

$ pkg contents -rt license -a must-accept=true -o license,pkg.name '*'
lic_OTN install-image/solaris-auto-install
lic_OTN release/notices

You might need to specify the --accept option to install or update these packages.

Use a command such as the following example to display the license text, as described in Displaying Package Licenses. You can list multiple FMRIs.

$ pkg info -r --license install-image/solaris-auto-install