JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 11 Express Image Packaging System Guide     Oracle Solaris 11 Express 11/10
search filter icon
search icon

Document Information

Preface

1.  Introduction to the Image Packaging System

2.  IPS Graphical User Interfaces

3.  Working With Packages

Package Management Tasks

Installing and Managing Packages

How to Install or Update a Package

How to Update a Package

How to View an Installation Action Without Installing

How to Verify a Package Installation

How to Fix Package Installation Errors

How to Uninstall Packages

How to Uninstall a Package From an Inactive Boot Environment

How to Search for Packages

How to Show the Contents of a Package

How to Show Information About Packages

How to List Package State Information

How to Display a Variant

How to Change a Variant

How to Display a Facet

How to Change a Facet

How to View and Delete Operation History

Managing Package Publishers

How to Display Publisher Information

How to Add, Modify, or Remove a Package Publisher

Installing Signed Packages

Image Properties for Signed Packages

Publisher Properties for Signed Packages

Configure Package Signature Properties

4.  Creating and Managing Images

A.  IPS Command Reference

Glossary

Installing and Managing Packages

IPS enables you to download and install software packages from an IPS package repository.

How to Install or Update a Package

By default, the newest version of a package that is compatible with the rest of the image is installed from the preferred publisher. If the package is already installed, the package is updated by installing the newest version of the package that is compatible with the rest of the image from the publisher that provided the currently installed version. If you have more than one publisher configured, you can control which publisher provides a package by setting publisher stickiness and search order or by specifying the publisher in the package FMRI. You can also specify the version you want to install in the package FMRI. See Fault Management Resource Identifiers for a description of a package FMRI. A BE might be created when you install, update, or uninstall a package. See Images and Boot Environments for information about creating new BEs and for descriptions of the --be-name, --require-new-be, and --deny-new-be options.

Example 3-1 Installing a Package

This example installs the installadm package. The output displays the status of the download, number of packages that were installed, number of files that were installed, and the size of the download in megabytes.

# pkg install install/installadm
DOWNLOAD     PKGS       FILES    XFER (MB)
Completed     9/9   1067/1067      6.1/6.1

PHASE                       ACTIONS
Install Phase             1458/1458

PHASE                         ITEMS
Package State Update Phase     9/9
Image State Update Phase       2/2

Example 3-2 Installing a Package From a Specific Publisher

To install a package from a specific publisher, specify the publisher name in the pkg-fmri.

# pkg install pkg://example.com/developer/sunstudio12u1

Example 3-3 Installing a Specific Version of a Package

To install a specific version of a package, specify the version information in the pkg-fmri.

# pkg install pkg:/developer/sunstudio12u1@12.1.1,5.11-0.111:20100306T002245Z

How to Update a Package

How to View an Installation Action Without Installing

You can check exactly what will be installed before you actually install anything. Using the -n option, you can execute the install command without making any persistent change. The -n option shows the changes that would be made if you executed the command without the -n option. You can also use the -n option with the update and uninstall subcommands.

Example 3-4 View an Installation Action Without Installing

The following command gives information about what would be installed but does not actually install anything.

# pkg install -n pkg:/developer/sunstudio12u1

How to Verify a Package Installation

Example 3-5 Verify the Installation of a Package

$ pkg verify -v e1000g
Verifying: PACKAGE                       STATUS
pkg://solaris/driver/network/e1000g      OK

How to Fix Package Installation Errors

How to Uninstall Packages

How to Uninstall a Package From an Inactive Boot Environment

  1. Mount the inactive BE from which the package is to be uninstalled.
    # beadm mount inactive-be mntpt
  2. Uninstall the package.
    # pkg -R mntpt uninstall pkg-fmri
  3. Unmount the previously mounted BE.
    # beadm unmount inactive-be

How to Search for Packages

Example 3-6 Searching for a Package in the Installed Image

The following example searches for the bash package in the installed image. The INDEX column tells you where in the data the match was found.

$ pkg search -l bash
INDEX      ACTION VALUE                      PACKAGE
pkg.fmri   set    solaris/shell/bash         pkg:/shell/bash@4.0.28-0.149
basename   file   usr/bin/bash               pkg:/shell/bash@4.0.28-0.149
basename   dir    etc/bash                   pkg:/shell/bash@4.0.28-0.149
basename   dir    usr/share/bash             pkg:/shell/bash@4.0.28-0.149

Example 3-7 Searching For a Package in a Specified Repository

In this example, two repositories that are not configured for this image are searched.

$ pkg search -s http://pkg.example1.com/release \
-s http://pkg.example2.com/release ksh

Example 3-8 Searching For a Package That Delivers a Specific File

This example shows that the libdhcpagent library came from the system/library package.

$ pkg search -l /lib/libdhcpagent.so.1
INDEX      ACTION VALUE                 PACKAGE
path       file   lib/libdhcpagent.so.1 pkg:/system/library@0.5.11-0.149

Example 3-9 Searching Using Wildcards and Boolean Directives

Multiple patterns are ANDed by default. You can also specify OR, *, and ?.

$ pkg search netbeans AND plug*in OR ide

Example 3-10 Searching Using Fields

The search string can be specified as the following set of fields:

pkg_name:action_type:key:token

Missing fields are implicitly wildcarded. Explicit wildcards can be used in the pkg_name and token fields. The action_type and key fields must match exactly. See “Actions” in the pkg(5) man page for a list of possible action types. Examples of keys include basename, description, and driver_name.

$ pkg search -l 'depend::package/pkg'
INDEX       ACTION VALUE                    PACKAGE
incorporate depend package/pkg@0.5.11-0.150 pkg:/consolidation/ips/ips-incorporation@0.5.11-0.150
require     depend package/pkg              pkg:/package/pkg/package-manager@0.5.11-0.150
require     depend package/pkg              pkg:/system/zones/brand/ipkg@0.5.11-0.150

How to Show the Contents of a Package

Example 3-11 Listing the Contents of a Package

In this example, the size and path of each file in the e1000g package are listed:

$ pkg contents -t file -o pkg.size,path network/e1000g
PKG.SIZE PATH
  471656 kernel/drv/amd64/e1000g
  323612 kernel/drv/e1000g
    4238 kernel/drv/e1000g.conf

How to Show Information About Packages

Example 3-12 Displaying Information About a Specific Package

This example displays information about the openoffice package. This example uses the -r option to display information even if the package is not installed.

$ pkg info -r openoffice
          Name: openoffice
       Summary: OpenOffice.org 3.1.0
      Category: Applications/Office
         State: Not installed
     Publisher: solaris
       Version: 3.1.0
 Build Release: 5.11
        Branch: 0.111
Packaging Date: May 18, 2009 06:27:12 AM
          Size: 430.65 MB
FMRI: pkg://solaris/openoffice@3.1.0,5.11-0.111:20090518T062712Z

Example 3-13 Displaying Copyright and License Information About a Package

This example displays the copyright and license information for the firefox package.

$ pkg info --license firefox
Copyright (c) 2008, 2010, Oracle and/or its affiliates.  All rights reserved.

Copyright (c) 1998-2010 by Contributors. All rights reserved.
Firefox and the Firefox logos are trademarks of the Mozilla Foundation. All rights reserved.

How to List Package State Information

Both the info and list subcommands display the package name and publisher and some version information. In addition to the package name and publisher, the pkg info command displays the package summary, category, and size. The pkg list command shows whether an update exists for the package, whether an update can be installed in this image, and whether a package is obsolete or renamed. The pkg info command displays several lines of information for each package. The pkg list command displays one line of information for each package.

Example 3-14 Listing a Package That Is Installed

In this example, the package is installed from the preferred publisher, and the package has an update available.

$ pkg list firefox
NAME (PUBLISHER)       VERSION         STATE      UFOXI
web/browser/firefox    0.5.11-0.150    installed  u----

Example 3-15 Listing the Newest Versions of a Package

Use the -n option to list the newest versions of a package from all configured publishers.

$ pkg list -n firefox
NAME (PUBLISHER)                     VERSION         STATE      UFOXI
web/browser/firefox (example.com)    0.5.11-0.151    known      -----
web/browser/firefox                  0.5.11-0.150    installed  u----

Example 3-16 Listing a Package That Is Not Installed

Use the -a option to list installed packages and the newest version that is available for installation. Packages are available for installation if they are allowed by the installed incorporations and by the variants of the image. In this example, the package is not currently installed but is available for installation from the preferred publisher. The package has been renamed from sunstudio12u1 to developer/sunstudio12u1.

$ pkg list -a sunstudio12u1
NAME (PUBLISHER)           VERSION         STATE      UFOXI
developer/sunstudio12u1    12.1.1-0.111    known      -----
sunstudio12u1              12.1.1-1        known      --r--

Example 3-17 Listing the Package Name and Summary

Use the -s option to display just the package name and summary.

$ pkg list -s developer/sunstudio12u1
NAME (PUBLISHER)           SUMMARY
developer/sunstudio12u1    Sun Studio - C, C++, & Fortran compilers and Tools

How to Display a Variant

A variant is a mutually exclusive component of a package such as architecture. Variants appear as tags on IPS actions and affect whether that action is installable. If an action has any variant tags, all variant tags must match the selection criteria to install the action.

Example 3-18 Displaying the Values of All Variants

$ pkg variant
VARIANT              VALUE
variant.solaris.zone global
variant.arch         i386

How to Change a Variant

Example 3-19 Changing a Variant

# pkg change-variant -n --accept variant.debug=false

How to Display a Facet

A facet is an optional component of a package such as a locale. Facets appear as tags on IPS actions and affect whether that action is installable. If an action has any facet tags, at least one facet tag must match the selection criteria to install the action.

Example 3-20 Displaying All Facets in the Current Image

$ pkg facet
FACETS       VALUE
facet.devel  FALSE

How to Change a Facet

Example 3-21 Changing a Facet in the Current Image

# pkg change-facet facet.devel=True
$ pkg facet facet.devel
FACETS       VALUE
facet.devel  TRUE

How to View and Delete Operation History

  1. Use the pkg history command to view the command history in the current image.

    Use the -l option to display more information, including the outcome of the command, the time the command completed, the version and name of the client used, the name of the user who performed the operation, and any errors encountered while executing the command. Use the -n option to display only the specified number of most recent operations.

    $ pkg history
    TIME                OPERATION                 CLIENT    OUTCOME
    2010-10-16T16:32:46 update-publisher          pkg       Succeeded
    2010-10-16T16:34:42 refresh-publishers        pkg       Succeeded
    2010-10-16T16:36:04 rebuild-image-catalogs    pkg       Succeeded
    2010-10-16T16:38:17 install                   pkg       Succeeded
  2. Use the pkg purge-history command to delete all command history information.
    # pkg purge-history