/usr/bin/pkgrecv [-aknrv] [-s (src_path|src_uri)] [-d (dest_path|dest_uri)] [-c cache_dir] [-m match] [--raw] [--key src_key --cert src_cert] [--dkey dest_key --dcert dest_cert] (fmri|pattern) ...
/usr/bin/pkgrecv [-s (src_path|src_uri)] --newest
/usr/bin/pkgrecv [-nv] [-s (src_path|src_uri)] [-d (dest_path|dest_uri)] [-p publisher]... [--key src_key --cert src_cert] --clone
pkgrecv retrieves all versions of each matching fmri or pattern from the pkg(5) repository or package archive specified by the –s option and optionally republishes the retrieved packages to the package repository or package archive specified by the –d option. By default, packages are retrieved in package repository format suitable for use with pkg, pkg.depotd, and package publication tools.
Packages that have not changed are not republished. Therefore, the time to update an existing repository depends on the number of new and changed packages.
Use the –m option to specify whether to retrieve all versions of each matching package, or only the newest version of each matching package.
If you do not specify '*' to be retrieved, you might want to specify the –r option to be sure to retrieve all the dependencies of the specified packages.
After a pkgrecv operation that retrieves packages into a dest_uri, if the dest_uri repository must support pkg search operations, run pkgrepo refresh on that repository to update 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 the –d option. The file specified by –d cannot already exist. The –a 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. The –a option cannot be combined with the –-raw option.
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 where the retrieved packages should be republished. If –a is specified, this destination must be a package archive that does not already exist. If –a is not specified, this destination must be a package repository that already exists. Use the pkgrepo command to create a new package repository. If –d is not specified, the value of PKG_DEST is used. See “Environment Variables” below.
Keep the retrieved package content compressed. This option is ignored when republishing. Compressed package content should not be used with pkgsend.
Control which versions of packages are retrieved if pattern is specified or if fmri is not fully specified. For this description, the following four example packages exist in the source specified by the –s option. In these FMRI, the characters between the @ and the : denote the numbered package version, and the characters from the : to the end denote the timestamp portion of the version string.
pkg://solaris/package/[email protected],5.11-0.175.1.0.0.24.0:20120904T180335Z pkg://solaris/package/[email protected],5.11-0.175.1.0.0.24.0:20120903T170234Z pkg://solaris/package/[email protected],5.11-0.175.1.0.0.23.0:20120820T165108Z pkg://solaris/package/[email protected],5.11-0.175.1.0.0.23.0:20120819T155007Z
Retrieve all versions of each matching fmri or pattern (implies all-versions). This is the default behavior if the –m option is not specified. In the example above, all four packages are retrieved.
Retrieve the latest timestamp for each version of each matching fmri or pattern. In the example above, the following two packages are retrieved:
pkg://solaris/package/[email protected],5.11-0.175.1.0.0.24.0:20120904T180335Z pkg://solaris/package/[email protected],5.11-0.175.1.0.0.23.0:20120820T165108Z
Retrieve only the newest version of each matching fmri or pattern. In the example above, only the following package is retrieved:
pkg://solaris/package/[email protected],5.11-0.175.1.0.0.24.0:20120904T180335Z
Perform a trial run with no changes made.
Only clone the specified publisher. This option can be specified multiple times. The –p option is valid only with the –-clone option.
Recursively retrieve all dependencies for each matching fmri or pattern.
Specify the file system path or URI of a pkg(5) repository or package archive from which to receive package data. If –s is not specified, the value of PKG_SRC is used. See “Environment Variables” below.
Display verbose output, including the number of packages retrieved and their full FMRIs, the number of files retrieved, and the estimated size of the transfer.
Specify a client SSL key file to use for package retrieval from the source HTTPS repository.
Specify a client SSL certificate file to use for package retrieval from the source HTTPS repository.
Specify a client SSL key file to use for package publication to the destination HTTPS repository.
Specify a client SSL certificate file to use for package publication to the destination HTTPS repository.
Make an exact copy of the source repository. By default, the clone operation succeeds only if publishers in the source repository are also present in the destination. To limit the clone operation to specified publishers, use the –p option. Publishers specified by using the –p option are added to the destination repository if they are not already present. Packages that are in the destination repository but not in the source repository are removed. The clone operation leaves the destination repository altered if an error occurs. Therefore, the destination repository should be in its own ZFS dataset, and a snapshot should be created prior to performing the clone operation.
List the most recent versions of the packages available from the repository specified by the –s option. All other options 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. The –-raw 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. The –-raw option cannot be combined with –a.
List the newest packages available from the repository on the system named test.
$ pkgrecv -s http://test --newest pkg://solaris/system/library/[email protected],5.11-0.175.0.0.0.2.1:20120921T190358Z pkg://solaris/system/library/[email protected],5.11-0.175.1.0.0.7.1234:20120109T215840Z pkg://solaris/system/library/[email protected],5.11-0.175.0.0.0.2.1:20120921T190432ZExample 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 protected],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-runtimeExample 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/vimExample 4 Retrieve Only the Latest Version
Receive only the latest version of the package editor/vim from the system named test.
$ pkgrecv -s http://test -d /local/repo -m latest -v \ editor/vim Processing packages for publisher solaris ... Retrieving and evaluating 1 package(s)... Retrieving packages ... Packages to add: 1 Files to retrieve: 1557 Estimated transfer size: 9.21 MB Packages to transfer: editor/[email protected],5.11-0.175.1.0.0.24.0:20120904T172128Z PROCESS ITEMS GET (MB) SEND (MB) Completed 1/1 9.2/9.2 25.4/25.4Example 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/zlibExample 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-emacsExample 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 https://pkg.oracle.com/solaris/support/ to the repository located at /export/repoSolaris11.
$ pkgrecv -s https://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-emacsExample 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:
Command succeeded.
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:
|
pkgrepo(1), pkgsend(1), pkg(5)
Copying and Creating Package Repositories in Oracle Solaris 11.2
https://java.net/projects/ips/pages/Home
When using a file system based destination repository, any pkg.depotd processes that are serving that repository must be restarted after package transfer is completed for the changes to be reflected in its web interface or search responses. See pkg.depotd(1M) for more information.