JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Image Packaging System Man Pages     Oracle Solaris 11 Information Library
search filter icon
search icon

Document Information

Preface

User Commands

packagemanager(1)

pkg(1)

pkgdepend(1)

pkgdiff(1)

pkgfmt(1)

pkglint(1)

pkgmerge(1)

pkgmogrify(1)

pkgrecv(1)

pkgrepo(1)

pkgsend(1)

pkgsign(1)

pm-updatemanager(1)

System Administration Commands

Standards, Environments, and Macros

pkgrecv

- Image Packaging System content retrieval utility

Synopsis

/usr/bin/pkgrecv [-s src_uri] [-a] [-d (path|dest_uri)]
    [-c cache_dir] [-kr] [-m match] [-n] [--raw]
    [--key keyfile --cert certfile] (fmri|pattern) ...
/usr/bin/pkgrecv [-s src_uri] --newest

Description

pkgrecv allows the user to retrieve packages from a pkg(5) repository or package archive. pkgrecv can also optionally republish the retrieved packages to a different package repository or archive them. By default, packages are retrieved in package repository format suitable for use with pkg(1), pkg.depotd(1M), and package publication tools.

Options

The following options are supported:

-a

Store the retrieved package data in a pkg(5) archive at the location specified by -d. The file cannot already exist. This option can be used only with file system based destinations. Although not required, using a file extension of .p5p (for example, archive.p5p) is strongly suggested. This option cannot be combined with --raw.

-c cache_dir

The path to a directory that will be used to cache downloaded content. If this directory is not supplied, the client automatically selects a cache directory. In the case where a download is interrupted, and a cache directory was automatically chosen, use this option to resume the download. See the “Environment Variables” section below for details about how to set the location used for temporary data storage.

-d path_or_uri

The file system path or URI of the target to republish packages to. The target must already exist. New repositories can be created using pkgrepo(1). If -a is specified, the target is assumed to be a new package archive.

-h

Display a usage message.

-k

Keep the retrieved package content compressed. This option is ignored when republishing. Compressed package content should not be used with pkgsend(1).

-m match

Controls matching behavior using the following values:

all-timestamps

Includes all matching timestamps, not just the latest (implies all-versions).

all-versions

Includes all matching versions, not just the latest.

-n

Perform a trial run with no changes made.

-r

Recursively retrieves all dependencies for the provided list of packages.

-s src_repo_uri

A URI representing the location of a pkg(5) repository or package archive from which to receive package data.

--cert file

Specify a client SSL certificate file to use for package retrieval from an HTTPS repository.

--key file

Specify a client SSL key file to use for package retrieval from an HTTPS repository.

--newest

List the most recent versions of the packages available from the specified repository and exit. (All other options except -s are ignored.)

--raw

Retrieve and store the raw package data in a set of directory structures by stem and version at the location specified by -d. This option can be used only with file system based destinations. This package data can be used to conveniently modify and republish packages, perhaps by correcting file contents or providing additional package metadata. This option cannot be combined with -a.

Examples

Example 1 List Newest Packages

List the newest packages available from the repository on the system named test.

$ pkgrecv -s http://test --newest
pkg:/SUNWlibC@0.5.11,5.11-0.79:20080221T125720Z
pkg:/SUNWfreetype2@0.5.11,5.11-0.79:20080221T123955Z
pkg:/SUNWlibm@0.5.11,5.11-0.79:20080221T125728Z
pkg:/SUNWliboil@0.5.11,5.11-0.79:20080221T125730Z

Example 2 Retrieve Raw Package Data

Receive the SUNWlibC, SUNWfreetype, and SUNWlibm packages from Example 1 in a format suitable for use with pkgsend include.

$ pkgrecv -s http://test \
SUNWlibC@0.5.11,5.11-0.79:20080221T125720Z --raw
SUNWfreetype2@0.5.11,5.11-0.79:20080221T123955Z
SUNWlibm@0.5.11,5.11-0.79:20080221T125728Z
$ ls -d SUNW*
SUNWfreetype2  SUNWlibC       SUNWlibm

Example 3 Retrieve Dependencies From a System

Receive the package SUNWvim and all of its dependencies from the system named test.

$ pkgrecv -s http://test -r SUNWvim

Example 4 Retrieve All Versions

Receive all versions of the package SUNWvim from the system named test.

$ pkgrecv -s http://test -m all-versions SUNWvim

Example 5 Retrieve All Versions and Republish Locally

Receive all versions of the package SUNWvim from the system named test and republish it to a local repository.

$ pkgrecv -s http://test -d /local/repo SUNWvim

Example 6 Retrieve All Versions and Republish Remotely

Receive all versions of the package SUNWzlib from the system named test and republish it to a remote repository on the system named remote.

$ pkgrecv -s http://test -d http://remote:10000 SUNWzlib

Example 7 Retrieve Dependencies From a Repository

Receive the package SUNWemacs and all of its dependencies from the repository located at /export/repo.

$ pkgrecv -s /export/repo -r SUNWemacs

Example 8 Retrieve Additional Packages

Receive all packages that do not already exist from the repository located at http://example.com:10000.

$ pkgrecv -s http://example.com:10000 -d /my/pkg/repo '*'

Example 9 Create a Package Archive

Create a package archive containing the package SUNWemacs and all of its dependencies from the repository located at http://example.com:10000.

$ pkgrecv -s http://example.com:10000 -d /my/emacs.p5p -a -r SUNWemacs

Example 10 Copy Packages From an Archive to a Repository

Copy all of the packages in a package archive to an existing repository located at /export/repo.

$ pkgrecv -s /my/archive.p5p -d /export/repo '*'

Environment Variables

The following environment variables are supported:

PKG_DEST

The path of a directory to save the retrieved package to, or the file system path or URI of a repository or package archive where the packages will be copied.

PKG_SRC

A URI or file system path representing the location of a pkg(5) repository or package archive from which to retrieve packages.

TMPDIR

The absolute path of the directory where temporary data should be stored during program execution. If not set, the default is to store temporary data in /var/tmp.

Exit Status

The following exit values are returned:

0

Command succeeded.

1

An error occurred.

2

Invalid command line options were specified.

3

Multiple operations were requested, but only some of them succeeded.

99

An unanticipated exception occurred.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
package/pkg
Interface Stability
Uncommitted

See Also

pkgrepo(1), pkgsend(1), pkg(5)

http://hub.opensolaris.org/bin/view/Project+pkg/