Skip Navigation Links | |
Exit Print View | |
Oracle Solaris 11 Express Image Packaging System Guide Oracle Solaris 11 Express 11/10 |
1. Introduction to the Image Packaging System
2. IPS Graphical User Interfaces
Installing and Managing Packages
How to Install or 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 a Package From an Inactive Boot Environment
How to Show the Contents of a Package
How to Show Information About Packages
How to Display Publisher Information
How to Add, Modify, or Remove a Package Publisher
Image Properties for Signed Packages
Publisher Properties for Signed Packages
Configure Package Signature Properties
IPS enables you to download and install software packages from an IPS package repository.
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.
You can specify more than one pkg-fmri pattern.
# pkg install pkg-fmri
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
The install subcommand installs the package if the package is not already installed in the image. If you want to be sure to update only packages that are already installed, and not install any new packages, then use the update subcommand.
You can specify more than one pkg-fmri pattern.
# pkg update pkg-fmri
Caution - If you use the pkg update command with no pkg-fmri specified, all installed packages that have updates available are updated. See Update an Image. |
If a newer version of an installed package is available and is compatible with the rest of the image, the package is updated to that version. See How to Install or Update a Package for a more complete description of what package is installed from which publisher.
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.
The -v option gives verbose information.
# pkg install -nv pkg-fmri
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
$ pkg verify pkg-fmri
You can specify more than one pkg-fmri pattern. Use the -v option to display information messages. Use the -q option to display only error messages.
Example 3-5 Verify the Installation of a Package
$ pkg verify -v e1000g Verifying: PACKAGE STATUS pkg://solaris/driver/network/e1000g OK
$ pkg fix --accept pkg-fmri
If you do not specify the --accept option, and any packages require a license to be accepted, the fix operation fails. Use the --licenses option to display all licenses for packages that are installed or updated by this fix operation.
You can specify more than one pkg-fmri pattern. You must specify at least one pkg-fmri pattern.
# pkg uninstall pkg-fmri
Use the -r option to recursively uninstall any packages that contain require dependencies on the pkg-fmri 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.
# beadm mount inactive-be mntpt
# pkg -R mntpt uninstall pkg-fmri
# beadm unmount inactive-be
You can specify more than one pattern. Multiple patterns are ANDed together.
$ pkg search pattern
By default, repositories associated with all publishers configured for this image are searched. Use the -l option to search only packages that are installed in this image. By default, matches are displayed only for currently installed or newer package versions. Use the -f option to display all matched versions.
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
By default, only the path attribute is shown. Use the -o option to specify additional attribute values to display. You can specify more than one pkg-fmri pattern. If you do not specify any pkg-fmri pattern, data are shown for all installed packages. If the package is not installed, use the -r option to retrieve data from all publishers configured for this image. When you use the -r option, you must specify one or more pkg-fmri patterns.
$ pkg contents pkg-fmri
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
You can specify more than one pkg-fmri pattern. If you do not specify any pkg-fmri pattern, information about all installed packages is displayed. If the package is not installed, use the -r option to retrieve data from all publishers configured for this image. When you use the -r option, you must specify one or more pkg-fmri patterns.
$ pkg info pkg-fmri
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.
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.
$ pkg list pkg-fmri
You can specify more than one pkg-fmri pattern. If you do not specify any pkg-fmri pattern, all installed packages are listed. The pkg list -u command lists all installed packages that have newer versions available.
The pkg list command displays the following information:
Name of the package. If the publisher is not the preferred publisher, then the publisher name is listed in parentheses after the package name.
The release and branch versions of the package. If you specify the -v option, the VERSION column is not shown. Instead, the full package FMRI is shown in the NAME column.
The state of the package. The state can be either “installed” or “known.”
Flags that give information about how the package relates to other packages in the image.
A u in the U column indicates that a newer version of this package is available. The newer version might not be possible to install because of package dependencies or other constraints. See the -a option in Example 3-16.
An o in the O column indicates that this package is obsolete. An r in the O column indicates that this package has been renamed.
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
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.
$ pkg variant variant_spec
You can specify more than one variant_spec.
Example 3-18 Displaying the Values of All Variants
$ pkg variant VARIANT VALUE variant.solaris.zone global variant.arch i386
# pkg change-variant -n --accept variant_spec=instance
Use the -n option to see what would change if you performed the operation without -n, but make no actual changes. A new BE might be created. See Images and Boot Environments.
Example 3-19 Changing a Variant
# pkg change-variant -n --accept variant.debug=false
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.
$ pkg facet facet_spec
You can specify more than one facet_spec.
Example 3-20 Displaying All Facets in the Current Image
$ pkg facet FACETS VALUE facet.devel FALSE
# pkg change-facet -n --accept facet_spec=True|False|None
Use the -n option to see what would change if you performed the operation without -n, but make no actual changes. A new BE might be created. See Images and Boot Environments.
If the facet value is set to None, the facet specification is removed from the current image.
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
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
# pkg purge-history