|Skip Navigation Links|
|Exit Print View|
|Image Packaging System Man Pages Oracle Solaris 11 Information Library|
- Image Packaging System content retrieval utility
/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
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.
The following options are supported:
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.
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.
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).
Display a usage message.
Keep the retrieved package content compressed. This option is ignored when republishing. Compressed package content should not be used with pkgsend(1).
Controls matching behavior using the following values:
Includes all matching timestamps, not just the latest (implies all-versions).
Includes all matching versions, not just the latest.
Perform a trial run with no changes made.
Recursively retrieves all dependencies for the provided list of packages.
A URI representing the location of a pkg(5) repository or package archive from which to receive package data.
Specify a client SSL certificate file to use for package retrieval from an HTTPS repository.
Specify a client SSL key file to use for package retrieval from an HTTPS repository.
List the most recent versions of the packages available from the specified repository and exit. (All other options except -s are ignored.)
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.
Example 1 List Newest Packages
List the newest packages available from the repository on the system named test.
$ pkgrecv -s http://test --newest pkg://firstname.lastname@example.org,5.11-0.174.0.0.0.0.0:20110921T190358Z pkg://email@example.com,5.11-0.175.1.0.0.7.1234:20120109T215840Z pkg://firstname.lastname@example.org,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 \ email@example.com,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 '*'
The following environment variables are supported:
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.
A URI or file system path representing the location of a pkg(5) repository or package archive from which to retrieve packages.
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.
The following exit values are returned:
An error occurred.
Invalid command line options were specified.
Multiple operations were requested, but only some of them succeeded.
An unanticipated exception occurred.
See attributes(5) for descriptions of the following attributes: