Getting Started With OpenSolaris 2008.05
Previous Next

pkg(1) Command Reference

The pkg(1) command enables users to create images, install and manage packages on their system. For the OpenSolaris 2008.05 release, the pkg command has the following sub-commands and options.

Table 2-8 pkg(1) Command

Subcommands

Description

pkg image-create

Creates an image suitable for package operations at the specified directory.

Syntax : pkg image-create [-FPUz] -a

  • -F– Creates a Full image

  • -P – Creates a partial image

  • -U – Creates a user image (default)

  • -z – Run the image in a non-global zone context

  • -a– Specify a repository server

pkg image-update

Updates all installed packages in the current image to the latest available version.

Syntax: pkg image-update [-nv]

  • -n - Execute the requested operation but make no persistent changes to the image.

  • -v - Issue verbose progress messages during the requested operation.

pkg refresh

Retrieves updated catalogs for each authority registered within the image.

Syntax: pkg refresh

pkg install

Installs a package.

Syntax: pkg install [-nv] pkg_fmri

  • -n - Execute the requested operation but make no persistent changes to the image.

  • -v - Issue verbose progress messages during the requested operation.

pkg uninstall

Uninstalls a package.

Syntax: pkg uninstall [-nrv] pkg_fmri

  • -n - Execute the requested operation but make no persistent changes to the image.

  • -v - Issue verbose progress messages during the requested operation.

  • -r - Recursively uninstall any packages which are dependent on the initial package.

pkg info

Displays information about a package.

Syntax : pkg info [--license] pkg_fmri

--license Display License and copyright information for a pacakge.

pkg list

Displays information about the state of packages in the current image.

Syntax: pkg list [-aHsuv] pkg_fmri

  • -a - Display information on all known packages, whether they are installed or not installed.

  • -H - Do not display any headers.

  • -s - Display only package name and description of the package.

  • -u - Show information only about packages which have newer versions available.

  • -v - Show detailed package FMRIs.

pkg search

Search for token, and display the FMRIs in which token was found.

Syntax: pkg search [-lr] [-s server] token

  • -l - Search the installed packages on the image.

  • -r - Search the repository that is linked to by the image.

  • -s - Search for packages in the specified server. Multiple servers can be specified.

pkg contents

Display the attributes of actions in the current image.

Syntax : pkg contents [-Hm] [-o attribute] [ -s sort_key] [-t action_type]

  • -m - Shows complete contents of the action as represented in the package manifest.

  • -o - Specify the attribute you are searching for. Multiple attributes may be specified with a single -o option by separating the attributes with commas.

  • -s - Sort the display based on the specified attribute.

  • -t - Display information only pertaining to the specified action.

  • -H - Do not display any headers.

pkg verify

Validate the installation of packages in the current image.

Syntax: pkg verify -[fv] pkg_fmri

  • -v - Display verbose information.

  • -f - Fully validate the contents of files against the hash values in the package manifests, as well as checking for file and directory presence

pkg set-authority

Update an existing authority or add an additional package authority.

Syntax: pkg set-authority [-P] [-k ssl_key] [-c ssl_cert] [-O origin_url] authority

  • -P - Set the specified authority as the preferred authority.

  • -c - Specify client SSL certificate.

  • -k - Specify client key.

  • -O - Set the URL prefix for the origin packaging repository for the authority.

pkg unset-authority

Remove the configuration associated with the given authority.

Syntax: pkg unset-authority authority

pkg authority

Display authority information. If an authority is specified, configuration values associated with the authority is displayed.

Syntax: pkg authority [-H] authority

  • No argument - Display the list of all configured authorities, and their origin URLs

  • -H- Remove headers from the listing.

Previous Next