PKGREPO(1) User Commands PKGREPO(1)

pkgrepoImage Packaging System repository management utility

pkgrepo create [--version ver] uri_or_path

pkgrepo add-publisher -s repo_uri_or_path publisher ...

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

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

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

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

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

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

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

pkgrepo remove [-n] [-d YYYYMMDD] [-p publisher]... -s repo_uri_or_path pkg_fmri_pattern ...

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

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

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

pkgrepo diff [-vq] [--strict] [--parsable] [-p publisher]... -s first_repo_uri_or_path [--key ssl_key --cert ssl_cert] -s second_repo_uri_or_path [--key ssl_key --cert ssl_cert]

pkgrepo help

pkgrepo version

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

The following global options are supported:

-? |
Display a usage message.

pkgrepo create [--version ver] uri_or_path

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

This sub-command can only be used with filesystem-based repositories.

Create a repository in a format compatible with the specified version. By default, version 4 repositories are created. Supported versions are:
Supports storage of packages for a single publisher, catalog version 1, and search version 1.
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 sub-command can only be used with version 4 filesystem-based repositories.

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 sub-command can only be used with version 4 filesystem-based repositories.

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.
repo_uri_or_path
Operate on the repository located at the given URI or file system path.
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.

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).
Omit the headers from the listing.
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.
repo_uri_or_path
Operate on the repository located at the given URI or file system path.
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).
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 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) 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. A value of l in the status column indicates that the package is legacy, meaning that it will be removed in the future. The fourth column contains the release and branch versions of the package. See pkg(7) for information about release and branch versions.

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 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.
Display all attributes of actions in the specified packages.
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 in the pkg(7) man page, such as file, dir, driver, depend, or set.

For descriptions of all other options, see the pkgrepo get 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.
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.
Do not rebuild package data.
Do not rebuild search indices.

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

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

Catalogue any new packages found in the repository and update all search indices. This is intended for use with deferred publication (--no-catalog or --no-index options of pkgsend(1)).
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.
Do not add any new packages.
Do not update search indices.

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

pkgrepo remove [-n] [-d YYYYMMDD] [-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) 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; 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.

YYYYMMDD
Filter the list of packages to be removed to those which have the provided YYYYMMDD date as part of their full package version.
Perform a trial run of the operation with no package changes made. A list of the packages to be removed is displayed before exiting.
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.
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]) ...

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

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

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.
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 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:

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:

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.
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.
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.

A paragraph of plain text that describes the purpose and contents of the repository.
A URI that represents the location of a document (such as a web page) that provides additional information about the repository.
The format used for storing catalogue files. The default value is ascii which is the legacy format and should not be changed unless the repository will be accessed solely by updated clients. The other available value is utf8 which allows clients to parse the catalogues faster and with less memory overhead.
A list of locations (URIs) for documents that provide additional legal information about the repository.
A list of locations (URIs) of repositories that contain a copy of the repository's package content but not the package metadata.
A plain text string that contains the name of the repository.
A list of locations (URIs) of repositories that contain a complete copy of the repository's package metadata and content.
An integer value that represents the number of seconds clients should wait before checking the repository for updated package data after each update check.
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.
A list of locations (URIs) of repositories that contain packages that users might be interested in.
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.
The absolute path name of the directory that contains the trust anchors for packages in this repository. If not specified, (/etc/ssl/pkg/) 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 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.

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.
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.

Include output detailing the errors found during repository verification.
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.
repo_uri_or_path
Operate on the repository located at the given URI or file system path.

pkgrepo diff [-vq] [--strict] [--parsable] [-p publisher]... -s first_repo_uri_or_path [--key ssl_key --cert ssl_cert] -s second_repo_uri_or_path [--key ssl_key --cert ssl_cert]

Compare two repositories and show the differences.

A symbol in the beginning of an output line indicates the item was found only in the first repository, while a symbol indicates the item was found only in the second repository. No symbol at the start of a line means that it is a common item.

Include output detailing the comparison including per-fmri output.
Compare catalog last modified time stamp. This is useful to determine whether one repository is an exact clone of another.
Generate parsable output in JSON format.
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.
repo_uri_or_path
Operate on the repository located at the given URI or file system path.
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.

pkgrepo help

Display a usage message.

pkgrepo version

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

Create a Package Repository
    $ pkgrepo create /my/repository
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 https://pkg.omnios.org/r151038/core/
    PUBLISHER PACKAGES STATUS           UPDATED
    omnios    863      online           2021-11-17T09:27:46.600621Z
Rebuild Catalogs and Search Data

Rebuild the repository's catalogs and search data.

    $ pkgrepo rebuild -s /my/repository
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
Display All Repository Properties
    $ pkgrepo get -s /my/repository
    SECTION    PROPERTY VALUE
    publisher  prefix   ""
    repository version  4

    $ pkgrepo get -s https://pkg.omnios.org/r151040/core/
    SECTION    PROPERTY                     VALUE
    publisher  prefix                       omnios
    repository check-certificate-revocation False
    repository signature-required-names     ()
    repository trust-anchor-directory       /etc/ssl/pkg/
    repository version                      4
Display All Publisher Properties
    $ pkgrepo get -s https://pkg.omnios.org/r151040/core/ -p all
    PUBLISHER SECTION    PROPERTY         VALUE
    omnios    publisher  alias
    omnios    publisher  prefix           omnios
    omnios    repository collection-type  core
    omnios    repository description      Packages for OmniOS r151040
    omnios    repository legal-uris       ()
    omnios    repository mirrors          ()
    omnios    repository name             OmniOS r151040 core
    omnios    repository origins          ()
    omnios    repository refresh-seconds
    omnios    repository registration-uri ""
    omnios    repository related-uris     ()
Set the Default Publisher
    $ pkgrepo set -s /my/repository publisher/prefix=example.com
Set a Publisher Property
    $ pkgrepo set -s /my/repository -p example.com \
	repository/origins=http://example.com/repository
Add a New Publisher To the Repository
    $ pkgrepo add-publisher -s /my/repository example.com

Command succeeded (or no differences encountered for pkgrepo diff).
An error occurred.
Invalid command line options were specified.
Multiple operations were requested, but only some of them succeeded.
No changes were made, nothing to do.
Differences found for pkgrepo diff.
An unanticipated exception occurred.

The command line interface of pkgrepo is . The output of pkgrepo is and may change at any time.

pkg(1), pkgrecv(1), pkgsend(1), glob(3C), pkg(7), pkg.depotd(8)

November 29, 2021 OmniOS