|Skip Navigation Links|
|Exit Print View|
|man pages section 1: User Commands Oracle Solaris 11.1 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, pkg.depotd, 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:
Display a usage message.
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.
Specify 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.
Specify 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.
Keep the retrieved package content compressed. This option is ignored when republishing. Compressed package content should not be used with pkgsend.
Control 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 retrieve all dependencies for the provided list of packages.
Specify 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://email@example.com,5.11-0.175.0.0.0.2.1:20120921T190358Z pkg://firstname.lastname@example.org,5.11-0.175.1.0.0.7.1234:20120109T215840Z pkg://email@example.com,5.11-0.175.0.0.0.2.1:20120921T190432Z
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 \ firstname.lastname@example.org,5.11-0.175.0.0.0.2.1:20120921T190358Z 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 and Changed Content
Receive all packages that do not already exist and all changed content from the repository located at http://pkg.oracle.com/solaris/release/ to the repository located at /export/repoSolaris11.
$ pkgrecv -s http://pkg.oracle.com/solaris/release/ \ -d /export/repoSolaris11 -m all-timestamps '*'
Receive all packages that do not already exist and all changed content from the secure repository located at http://pkg.oracle.com/solaris/support/ to the repository located at /export/repoSolaris11.
$ pkgrecv -s http://pkg.oracle.com/solaris/support/ \ -d /export/repoSolaris11 -m all-timestamps \ --key /var/pkg/ssl/Oracle_Solaris_11_Support.key.pem \ --cert /var/pkg/ssl/Oracle_Solaris_11_Support.certificate.pem '*'
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: