Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

OpenSolaris 2008.11 Image Packaging System Guide
Previous Next

pkg(1) Command Reference

For the OpenSolaris 2008.11 release, the pkg command has the following sub-commands and options.

All the pkg commands accept -R dir as an option, which instructs the command to operate on the image rooted at dir, rather than the one discovered automatically.

Table 8-1 pkg(1) Commands

Subcommands

Description

Privileges Required to Run Command?

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

  • -f– Force the command to create an image over an existing image


    Caution - Use this option with care. See Image Creation: Important Considerations section.


  • -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

Yes

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.

  • -q - No message are shown during command execution.

  • --no-refresh - Do not attempt to contact the image's authorities to retrieve their catalogs.

Yes

pkg refresh

Retrieves updated catalogs for each authority registered within the image.

Syntax: pkg refresh [-full] [authority..]

  • -full - Retrieve full catalog.

  • When no authority is specified, the command retrieves updates for all authorities registered within the image.

No

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.

  • --no-refresh - Do not attempt to contact the image's authorities to retrieve their catalogs.

Yes

pkg uninstall

Uninstalls a package.

Syntax: pkg uninstall [-nrvq] 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.

  • --no-refresh - Do not attempt to contact the image's authorities to retrieve their catalogs.

Yes

pkg info

Displays information about a package.

Syntax : pkg info [-lr] [--license] pkg_fmri

  • -l – Display the data available from locally installed packages. This is the default option.

  • -r – Use this option to retrieve information about a package. A package FMRI must be specified with this option.

  • --license – Display License and copyright information for a package.

No

pkg contents

Display the contents (action attributes) of packages in the current image.

Syntax : pkg contents [-Hmr] [-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. If this option is not specified, only the path attribute is displayed.

  • -r - Retrieves the contents of a package from the server. This is used in cases where the package is not already installed. A package FMRI must be specified when using this option.

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

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

  • -H - Do not display any headers.

Yes

pkg search

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

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

  • -l - Search the installed packages on the image. This is the default option.

  • -r - Search the repository corresponding to the image's authorities. This option can be combined with the -l option.

  • -s - Search for packages in the specified server, a pkg(5) repo. Multiple servers can be specified. This option can be combined with the -l option.

  • -I - Search for packages in a case sensitive manner.


    Note - The -I option can only be used with the default option, -l at this time.


No

pkg list

Displays most recent version information about the state of packages in the current image.

Syntax: pkg list [-aHsuvf] 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.

  • -f - List all known versions of a package.

No

pkg verify

Validate the installation of packages in the current image.

Syntax: pkg verify -[Hqv] pkg_fmri

  • -v - Display verbose information.

  • -q - Do not report anything but return failure if there are any verification problems.

  • -H - Remove headers from the listing.

Yes

pkg fix

Fix any errors reported by pkg verify

Syntax : pkg fix pkg_fmri

Yes

pkg set-property propname propvalue

Update an existing image property or add a new image property.

Yes

pkg unset-property propname propvalue

Remove an existing image property or add a new image property.

Yes

pkg property [propname..]

Display image property information.

  • No argument – Display name and values for all image properties.

  • -H – Remove headers from the listing.

No

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] [--no-refresh] [--reset-uuid] 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.

  • --no-refresh - Do not attempt to contact the specified authority to retrieve the catalog.

  • ---reset-uuid - Choose a new, unique identifier to identify this image to the authority.

Yes

pkg unset-authority

Remove the configuration associated with the given authority.

Syntax: pkg unset-authority authority

Yes

pkg authority

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

Syntax: pkg authority [-HP] authority

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

  • -H- Remove headers from the listing.

  • -P- Display only preferred authority information.

No

pkg history

Display the history of commands executed in the image.

Syntax : pkg history [-Hl]

  • -H – Remove headers from the listing.

  • -l – Display detailed history information which includes the outcome of the command, when the command completed execution, version and name of the client used, identity of the user who performed the operation, and any errors encountered while executing the command.

No

pkg purge-history

Delete all existing history information.

Yes

pkg help

View a list of all available commands and their associated options.

No

Previous Next

 
 
  Published under the terms fo the Public Documentation License Version 1.01. Design by Interspire