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.

After a pkgrecv operation, run pkgrepo refresh or pkgrepo rebuild on the repository to build search indexes.

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. If -a is specified, the target is a new package archive that cannot already exist. Otherwise, the target must be a package repository that already exists. New repositories can be created using pkgrepo(1).

-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://solaris/system/library/c++-runtime@0.5.11,5.11-0.174.0.0.0.0.0:20110921T190358Z
pkg://solaris/system/library/freetype-2@2.4.8,5.11-0.175.1.0.0.7.1234:20120109T215840Z
pkg://solaris/system/library/math@0.5.11,5.11-0.174.0.0.0.0.0:20110921T190432Z

Example 2 Retrieve Raw Package Data

Receive the c++-runtime package from Example 1 in a format suitable for use with pkgsend publish.

$ pkgrecv -s http://test \
-d /local/repo --raw \
c++-runtime@0.5.11,5.11-0.174.0.0.0.0.0:20110921T190358Z
Processing packages for publisher solaris ...
Retrieving and evaluating 1 package(s)...
PROCESS                                         ITEMS     GET (MB)    SEND (MB)
Completed                                         1/1      3.5/3.5      0.0/0.0
$ ls /local/repo
pkg5.repository  publisher  system%2Flibrary%2Fc%2B%2B-runtime

Example 3 Retrieve Dependencies From a System

Receive the package editor/vim and all of its dependencies from the system named test.

$ pkgrecv -s http://test -d /local/repo -r editor/vim

Example 4 Retrieve All Versions

Receive all versions of the package editor/vim from the system named test.

$ pkgrecv -s http://test -d /local/repo -m all-versions editor/vim
Processing packages for publisher solaris ...
Retrieving and evaluating 2 package(s)...
PROCESS                                        ITEMS     GET (MB)    SEND(MB)
Completed                                        2/2    16.7/16.7    44.9/44.9

Example 5 Retrieve All Versions and Republish Remotely

Receive all versions of the package library/zlib 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 -m all-versions library/zlib

Example 6 Retrieve Dependencies From a Repository

Receive the package editor/gnu-emacs and all of its dependencies from the repository located at /export/repo.

$ pkgrecv -s /export/repo -d /local/repo -r editor/gnu-emacs

Example 7 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 8 Create a Package Archive

Create a package archive containing the package editor/gnu-emacs 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 editor/gnu-emacs

Example 9 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/