man pages section 1: User Commands

Exit Print View

Updated: July 2014
 
 

pkgrepo(1)

Name

pkgrepo - Image Packaging System repository management utility

Synopsis

/usr/bin/pkgrepo create [--version ver] uri_or_path
/usr/bin/pkgrepo add-publisher -s repo_uri_or_path
    publisher ...
/usr/bin/pkgrepo remove-publisher [-n] [--synchronous]
    -s repo_uri_or_path publisher ...
/usr/bin/pkgrepo get [-F format] [-H] [-p publisher]...
    -s repo_uri_or_path [--key ssl_key --cert ssl_cert]...
    [section/property ...]
/usr/bin/pkgrepo info [-F format] [-H] [-p publisher]...
    -s repo_uri_or_path [--key ssl_key --cert ssl_cert]...
/usr/bin/pkgrepo list [-F format] [-H] [-p publisher]...
    -s repo_uri_or_path [--key ssl_key --cert ssl_cert]...
    [pkg_fmri_pattern ...]
/usr/bin/pkgrepo contents [-m]
    [-t action_name[,action_name]...]... -s repo_uri_or_path
    [--key ssl_key --cert ssl_cert]... [pkg_fmri_pattern...]
/usr/bin/pkgrepo rebuild [-p publisher]...
    -s repo_uri_or_path [--key ssl_key --cert ssl_cert]...
    [--no-catalog] [--no-index]
/usr/bin/pkgrepo refresh [-p publisher]...
    -s repo_uri_or_path [--key ssl_key --cert ssl_cert]...
    [--no-catalog] [--no-index]
/usr/bin/pkgrepo remove [-n] [-p publisher]...
    -s repo_uri_or_path pkg_fmri_pattern ...
/usr/bin/pkgrepo set [-p publisher]... -s repo_uri_or_path
    section/property=[value] ...
/usr/bin/pkgrepo set [-p publisher]... -s repo_uri_or_path
    section/property=([value]) ...
/usr/bin/pkgrepo verify [-p publisher]...
    -s repo_uri_or_path
/usr/bin/pkgrepo fix [-v] [-p publisher]...
    -s repo_uri_or_path
/usr/bin/pkgrepo help
/usr/bin/pkgrepo version

Description

pkgrepo provides the ability to create and manage pkg(5) package repositories. Package repositories are a predefined set of directories and files that permit the storage and retrieval of package data by pkg and publication clients such as pkgsend or pkgrecv. In addition, when network-based access to a package repository is needed, pkg.depotd can provide clients access to the repository to store and/or retrieve package data.

Options

The following options are supported:

–?
–-help

Display a usage message.

Sub Commands

The following subcommands are supported:

pkgrepo create [–-version ver] uri_or_path

Create a pkg(5) repository at the specified location.

This subcommand can be used only with file system based repositories.

–-version

Create a repository in a format compatible with the specified version. By default, version 4 repositories are created. Supported versions are:

3

Supports storage of packages for a single publisher, catalog version 1, and search version 1.

4

Supports storage of packages for multiple publishers, catalog version 1, and search version 1.

pkgrepo add-publisher –s repo_uri_or_path publisher ...

Add the specified publishers to the repository. The new publishers have no packages or content.

This subcommand can be used only with version 4 file system based repositories.

–s repo_uri_or_path

Operate on the repository located at the given URI or file system path.

pkgrepo remove-publisher [–n] [–-synchronous] –s repo_uri_or_path publisher ...

Remove the specified publishers from the repository. Remove all packages and all other data for the specified publishers.

If the default publisher is removed, and only one publisher remains in the repository, that remaining publisher becomes the default. The publisher/prefix property of the repository is set to that remaining publisher.

If the default publisher is removed, and multiple publishers remain in the repository, or if the last publisher is removed from the repository, the publisher/prefix property is unset.

This subcommand can be used only with version 4 file system based repositories.

–n

Perform a trial run of the operation with no publisher changes made. The number of packages to be removed for each publisher is displayed before exiting.

–s repo_uri_or_path

Operate on the repository located at the given URI or file system path.

–-synchronous

Wait for the operation to complete before returning. If this option is not specified, the command returns immediately while the publisher is removed asynchronously in the background.

pkgrepo get [–F format] [–H] [–p publisher]... –s repo_uri_or_path [–-key ssl_key –-cert ssl_cert]... [section/property ...]

Display the property information for the repository or its publishers.

By default, each property and its value are printed on separate lines. Empty ASCII string values are represented by a pair of double quotation marks (""). The following Bourne shell metacharacters, and newline, space, and tab, in ASCII string values must be escaped by backslash characters (\):

; & ( ) | ^ < > \ " ' `

See the “Examples” section for examples displaying publisher and repository properties.

For a list of properties and the purpose and value of each property, see the set subcommand below.

–F format

Specify an alternative output format. The value of format can be tsv (Tab Separated Values), json (JavaScript Object Notation as a single line), or json-formatted (JavaScript Object Notation, formatted for readability).

–H

Omit the headers from the listing.

–p publisher

Display the property information for the given publisher. The special value all displays the properties for all publishers. This option can be specified multiple times.

–s repo_uri_or_path

Operate on the repository located at the given URI or file system path.

–-key ssl_key –-cert ssl_cert

Use the –-key option to specify a client SSL key file to use for package retrieval from an HTTPS repository. Use the –-cert option to specify a client SSL certificate file to use for package retrieval from an HTTPS repository. This option pair can be specified multiple times.

section/property

Display values for only the specified properties, such as publisher/prefix or repository/version. See the set subcommand for a complete list of properties.

pkgrepo info [–F format] [–H] [–p publisher]... –s repo_uri_or_path [–-key ssl_key –-cert ssl_cert]...

Display a listing of the package publishers known by the repository. The listing includes the number of packages for each publisher, when the publisher's package data was last updated, and the status of the publisher's package data (such as whether it is currently being processed).

–p publisher

Only display the data for the given publisher. If not provided, the data for all publishers is displayed. This option can be specified multiple times.

For descriptions of all other options, see the pkgrepo get command above.

pkgrepo list [–F format] [–H] [–p publisher]... –s repo_uri_or_path [–-key ssl_key –-cert ssl_cert]... [pkg_fmri_pattern ...]

List the packages in the repo_uri_or_path repository that match the specified pkg_fmri_pattern patterns. If no patterns are specified, all packages in the repository are listed. The pkg_fmri_pattern pattern can include the ? and * characters as glob(3C)-style wildcards to match one or more packages.

In the default output, the first column contains the name of the publisher of the package. The second column contains the name of the package. The third column is a flag that shows the status of the package. A value of o in the status column indicates the package is obsolete. A value of r in the status column indicates the package has been renamed, which is a form of obsoletion. The fourth column contains the release and branch versions of the package. See pkg(5) for information about release and branch versions.

–p publisher

Only display the packages for the given publisher. If not provided, the packages for all publishers are listed. This option can be specified multiple times.

For descriptions of all other options, see the pkgrepo get command above.

pkgrepo contents [–m [–t action_name[,action_name]...]... –s repo_uri_or_path [–-key ssl_key –-cert ssl_cert]... [pkg_fmri_pattern...]

List all packages in the repo_uri_or_path repository. If pkg_fmri_pattern is specified, display the contents (action attributes) of all matching packages in the repository.

–m

Display all attributes of actions in the specified packages.

–t action_name

Display only the specified actions in the specified packages. The –t option can be specified multiple times, or multiple actions can be specified as the argument to one –t option by separating the action names with commas. The value of action_name is one of the actions listed in “Actions” in the pkg(5) man page, such as file, dir, driver, depend, or set.

For descriptions of all other options, see the pkgrepo get command above.

pkgrepo rebuild [–p publisher]... –s repo_uri_or_path [–-key ssl_key –-cert ssl_cert]... [–-no-catalog] [–-no-index]

Discard all catalog, search, and other cached information found in the repository, and then recreate it based on the current contents of the repository.

–p publisher

Perform the operation only for the given publisher. If not provided, or if the special value all is specified, the operation is performed for all publishers. This option can be specified multiple times.

–-no-catalog

Do not rebuild package data.

–-no-index

Do not rebuild search indexes.

For descriptions of all other options, see the pkgrepo get command above.

pkgrepo refresh [–p publisher]... –s repo_uri_or_path [–-key ssl_key –-cert ssl_cert]... [–-no-catalog] [–-no-index]

Catalog any new packages found in the repository and update all search indexes. This is intended for use with deferred publication (–-no-catalog or –-no-index options of pkgsend).

–p publisher

Perform the operation only for the given publisher. If not provided, or if the special value all is specified, the operation is performed for all publishers. This option can be specified multiple times.

–-no-catalog

Do not add any new packages.

–-no-index

Do not update search indexes.

For descriptions of all other options, see the pkgrepo get command above.

pkgrepo remove [–n] [–p publisher]... –s repo_uri_or_path pkg_fmri_pattern ...

Remove packages that match the specified pkg_fmri_pattern pattern from the repository, including any files they reference that are not in use by any other package. The pkg_fmri_pattern pattern can include the ? and * characters as glob(3C)-style wildcards to match one or more packages.


Note - All search index data for related publishers is removed.

This subcommand can be used only with file system based repositories.


Caution

Caution  - This operation is not reversible and should not be used while other clients are accessing the repository since it might cause them to fail during retrieval operations.


–n

Perform a trial run of the operation with no package changes made. A list of the packages to be removed is displayed before exiting.

–p publisher

Only remove matching packages for the given publisher. If not provided, any matching packages are removed for all publishers. This option can be specified multiple times.

–s repo_uri_or_path

Operate on the repository located at the given URI or file system path.

pkgrepo set [–p publisher]... –s repo_uri_or_path section/property=[value] ...
pkgrepo set [–p publisher]... –s repo_uri_or_path section/property=([value]) ...

Set the value of the specified properties for the repository or publisher.

This subcommand can be used only with file system based repositories.

–p publisher

Only set property data for the given publisher. If the publisher does not already exist, it is added. The special value all can be used to set the property for all publishers.

–s repo_uri_or_path

Operate on the repository located at the given URI or file system path.

Properties and values can be specified using one of the following forms:

section/property=

Clear the property value.

section/property=value

Replace the property value with the given value.

section/property=(value1 value2 valueN)

Replace the property value with the list of values.

For repository versions 3 and 4, the following properties can be set for the repository:

publisher/prefix

A string that represents the name of the default publisher. The first character must be a-z, A-Z, or 0-9. The remainder of the string can only contain the characters 0-9, -, ., a-z, and A-Z. This value indicates the publisher that should be used when more than one publisher's packages are present, or when packages are published to the repository and a publisher is not specified.

For repository versions 3 and 4, the following properties can be set for individual publishers in the repository. Use the –p option to specify at least one publisher when you set these properties:

publisher/alias

A string that represents the default alias that clients should use when adding a publisher using the repository's configuration data. The first character must be a-z, A-Z, or 0-9. The remainder of the string can only contain the characters 0-9, -, ., a-z, and A-Z.

repository/check-certificate-revocation

A boolean to check whether a certificate has been revoked. When this property is set to True, the pkgrepo verify and pkgrepo fix commands attempt to contact any CRL distribution points in the certificates used for signature verification to determine whether the certificate has been revoked since being issued. The default value is False. This property is only used by the verify and fix subcommands to validate the contents of the repository. This property does not affect client settings. This value should be the same as the corresponding pkg(1) property value.

repository/collection_type

Can have the value core or supplemental, indicating the type of packages offered in this repository.

The core type indicates that the repository contains all of the dependencies declared by packages in the repository. The core type is primarily used for operating system repositories.

The supplemental type indicates that the repository contains packages that rely on or are intended to be used with packages located in another repository.

repository/description

A paragraph of plain text that describes the purpose and contents of the repository.

repository/detailed_url

A URI that represents the location of a document (such as a web page) that provides additional information about the repository.

repository/legal_uris

A list of locations (URIs) for documents that provide additional legal information about the repository.

repository/mirrors

A list of locations (URIs) of repositories that contain a copy of the repository's package content but not the package metadata.

repository/name

A plain text string that contains the name of the repository.

repository/origins

A list of locations (URIs) of repositories that contain a complete copy of the repository's package metadata and content.

repository/refresh_seconds

An integer value that represents the number of seconds clients should wait before checking the repository for updated package data after each update check.

repository/registration_uri

A URI that represents the location of a resource that must be used to obtain credentials for access to the repository. A registration web page is one example.

repository/related_uris

A list of locations (URIs) of repositories that contain packages that users might be interested in.

repository/signature-required-names

A list of names that must be seen as common names of certificates while validating the signatures of a package. This property is only used by the verify and fix subcommands to validate the contents of the repository. This property does not affect client settings. These values should be the same as the corresponding pkg(1) property values.

repository/trust-anchor-directory

The absolute path name of the directory that contains the trust anchors for packages in this repository. If not specified, /etc/certs/CA/ is used. This property is only used by the verify and fix subcommands to validate the contents of the repository. This property does not affect client settings. This value should be the same as the corresponding pkg(1) property value.

Properties not documented here, but listed in the output of the get subcommand, are reserved for internal use and should not be set.

pkgrepo verify [–p publisher]... –s repo_uri_or_path

Verify that the following attributes of the package repository contents are correct:

  • File checksums

  • File permissions

    The path leading to the repository is also checked to ensure that the pkg5srv user can read the repository contents. This check can be necessary for repositories that are made available using the svc:/application/pkg/server service, or using the svc:/application/pkg/system-repository service when the system has non-global zones.

  • Package manifest permissions

  • Package manifest content

  • Package signatures

    Package manifest signatures are calculated based on the values of the repository/signature-required-names , repository/trust-anchor-directory, and repository/check-certificate-revocation properties.

Errors are emitted to stdout. The pkgrepo command exits with a non-zero return code if any errors are emitted.

This subcommand can be used only with version 4 file system based repositories.

–p publisher

Perform the operation only for the specified publisher. If no publisher is specified, or if the special value all is specified, the operation is performed for all publishers. This option can be specified multiple times.

–s repo_uri_or_path

Operate on the repository located at the given URI or file system path.

pkgrepo fix [–v] [–p publisher]... –s repo_uri_or_path

Fix the contents of a repository by first verifying the repository, and then moving any invalid repository contents into a quarantine directory within the repository.

If repository errors are found, a repository rebuild is automatically performed. If any errors are found, a message is emitted to stdout showing which packages must be re-imported using pkgsend(1) or pkgrecv(1) in order to restore the repository contents.

This subcommand can be used only with version 4 file system based repositories.

–v

Include output detailing the errors found during repository verification.

–p publisher

Perform the operation only for the specified publisher. If no publisher is specified, or if the special value all is specified, the operation is performed for all publishers. This option can be specified multiple times.

–s repo_uri_or_path

Operate on the repository located at the given URI or file system path.

pkgrepo help

Display a usage message.

pkgrepo version

Display a unique string that identifies the version of the pkg(5) system. The values produced by the version operation are not sortable and are not safe for comparison beyond equality.

Examples

Example 1 Create a Package Repository
$ pkgrepo create /my/repository
Example 2 Display Information

Display a summary of publishers and the number of packages in a repository.

$ pkgrepo info -s /my/repository
PUBLISHER   PACKAGES STATUS UPDATED
example.com 5        online 2011-07-22T18:09:09.769106Z
$ pkgrepo info -s http://pkg.oracle.com/solaris/release/
PUBLISHER PACKAGES STATUS UPDATED
solaris   3941     online 2010-11-12T19:24:25.967246Z
Example 3 Rebuild Catalogs and Search Data

Rebuild the repository's catalogs and search data.

$ pkgrepo rebuild -s /my/repository
Example 4 Refresh Catalogs and Search Data

Refresh the repository's catalogs and search data.

$ pkgrepo refresh -s /my/repository
$ pkgrepo refresh -s http://example.com/repository
Example 5 Display All Repository Properties
$ pkgrepo get -s /export/repoSolaris11
SECTION    PROPERTY    VALUE
publisher  prefix      solaris
repository description Local\ copy\ of\ the\ Oracle\ Solaris\ 11\ repository
repository name        Oracle\ Solaris\ 11
repository version     4
$ pkgrepo get -s http://pkg.oracle.com/solaris/release/
SECTION    PROPERTY VALUE
deployment content  s11_11-11
deployment pubdate  20111102T222051Z
publisher  prefix   solaris
repository version  4
Example 6 Display All Publisher Properties
$ pkgrepo get -s http://pkg.oracle.com/solaris/release/ -p all

PUBLISHER SECTION    PROPERTY         VALUE
solaris   publisher  alias
solaris   publisher  prefix           solaris
solaris   repository collection-type  core
solaris   repository description      This\ repository\ serves\ the\ Oracle\
Solaris\ 11\ Package\ repository.
solaris   repository legal-uris       ()
solaris   repository mirrors          (http://pkg-cdn1.oracle.com/solaris.release/)
solaris   repository name             Oracle\ Solaris\ 11\ Package\ Repository
solaris   repository origins          ()
solaris   repository refresh-seconds
solaris   repository registration-uri ""
solaris   repository related-uris     ()
Example 7 Set the Default Publisher
$ pkgrepo set -s /my/repository publisher/prefix=example.com
Example 8 Set a Publisher Property
$ pkgrepo set -s /my/repository -p example.com \
repository/origins=http://example.com/repository
Example 9 Add a New Publisher To the Repository
$ pkgrepo add-publisher -s /my/repository example.com

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.

4

No changes were made, nothing to do.

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

pkg(1), pkgrecv(1), pkgsend(1), pkg.depotd(1M), pkg(5)

Copying and Creating Package Repositories in Oracle Solaris 11.2

https://java.net/projects/ips/pages/Home

Notes

Most pkgrepo operations are not available for package archives. A package archive is a file, typically with a .p5p extension, as described in the –a option in the pkgrecv(1) man page. A package archive contains packages but does not contain repository configuration. However, the pkgrepo list, pkgrepo info, and pkgrepo contents commands work with package archives.