Use the pkg set-publisher command to perform the following operations:
Configure a new publisher
Set publisher origins and mirrors
Set publisher stickiness
Set publisher search order
Set and unset a publisher property, and add and remove a publisher property value
Specify SSL keys and certificates for a publisher
Set a publisher proxy
Enable or disable a publisher
Remove a publisher
The pkg set-publisher command has two forms. See the pkg(1) man page for details.
In one form, the name of the publisher is a required operand.
In the other form, a repository URI is provided as the argument to the -p option, and publisher information is retrieved from that specified repository. The publisher name is an optional operand so that you can configure only the named publisher if multiple publishers publish packages to that repository.
The examples below show both methods for adding a publisher.Example 5-1 Specify a New Publisher
The following command adds a new publisher named devtool with an origin URI specified with the -g option and sets this publisher to be first in the search order. Use the -P option or the --search-first option to set the specified publisher first in the search order.
$ pkg set-publisher -P -g http://pkg.example1.com/release/ devtoolExample 5-2 Import Publisher Configuration
Use the -p option to retrieve publisher configuration information from the specified repository URI. If a publisher is specified, then only the matching publisher is added or updated. If no publisher is specified, all publishers are added or updated as appropriate.
$ pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://pkg.oracle.com/solaris/release/ $ pkg set-publisher -p /export/IPSpkgrepos/myrepo $ pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://pkg.oracle.com/solaris/release/ site origin online F file:///export/IPSpkgrepos/myrepo/
The following commands show adding an origin to the solaris publisher. If multiple origins are configured for a given publisher in an image, the IPS client attempts to choose the best origin from which to retrieve package data.
$ pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://pkg.oracle.com/solaris/release/ $ pkg set-publisher -g /export/IPSpkgrepos/Solaris solaris $ pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://pkg.oracle.com/solaris/release/ solaris origin online F file:///export/IPSpkgrepos/Solaris/
Use the -G option to remove a URI as an origin for the specified publisher.
To change an origin URI for a publisher, add the new URI and remove the old URI.
$ pkg set-publisher -G '*' -g file:///export/IPSpkgrepos/isvrepo/ isvpub
Use the -m option to add a URI as a mirror for the specified publisher. See Repository Origins and Mirrors for an explanation of the difference between an origin and a mirror. You cannot access the content in a mirror repository unless the same version of the same package also exists in an origin repository for that same publisher.
$ pkg set-publisher -m http://pkg.example3.com/ devtool $ pkg publisher PUBLISHER TYPE STATUS P LOCATION devtool origin online F http://pkg.example1.com/ devtool mirror online F http://pkg.example3.com/
Use the -M option to remove a URI as a mirror for the specified publisher.
To change a mirror URI for a publisher, add the new URI and remove the old URI.
A newly added publisher is sticky by default. If a publisher is non-sticky, then a package that was installed from this publisher could be updated from another publisher. Use the --sticky and --non-sticky options to set publisher stickiness.
A newly added publisher is last in the search order by default. The publisher search order is used to find packages to install. The publisher search order is used to find packages to update if the publisher that the package was originally installed from is non-sticky. Use the --search-before, --search-after, and --search-first options for changing publisher search. The -P option is a synonym for the --search-first option.
The first publisher that provides a matching package is used as the installation source. If that publisher does not provide a version of the package that can be installed in this image, then the installation operation fails. To install from a publisher further down the search order, provide more information in the package FMRI, such as the publisher name or the package version string.
Use the following options to set and unset publisher properties and to add and remove values of publisher properties:
The publisher-search-order and signature-required-names properties can take multiple values.
See the pkg set-publisher examples in Configuring Package Signature Properties.
Use the -k option to specify the client SSL key. Use the -c option to specify the client SSL certificate. Use the --approve-ca-cert option to add the specified certificate as a CA certificate that is trusted. The hashes of the user-approved CA certificates are listed in the output of the pkg publisher command for this publisher. See Displaying Publisher Information.
$ pkg set-publisher -k /root/creds/example.key -c /root/creds/example.cert \ --approve-ca-cert /tmp/example_file.pem isvpubExample 5-4 Revoke a Publisher Key and Certificate
Use the --revoke-ca-cert option to treat the specified certificate as revoked. The hashes of the user-revoked CA certificates are listed in the output of the pkg publisher command for this publisher.
Use the --unset-ca-cert option to remove the specified certificate from the list of approved certificates and from the list of revoked certificates.
Use the --proxy option to specify a persistent proxy URI from which to retrieve content for the specified origin or mirror. The value of the proxy is protocol://host[:port], where protocol is http or https and :port is optional. See Specifying a Proxy for information about different ways to set a proxy.
A newly added publisher is enabled by default. A disabled publisher is not used when populating the package list or in install, uninstall, or update package operations. The properties for a disabled publisher can still be set and viewed. If only one publisher is enabled, that publisher cannot be disabled.
The following command enables the isvpub publisher and sets it ahead of the devtool publisher in the search order.
$ pkg set-publisher --enable --search-before devtool isvpub
Use the --disable option to disable a publisher. You might want to disable a publisher if the publisher origin is temporarily unreachable, for example. If any publisher is unreachable, package installation and update operations fail.
Use the pkg unset-publisher command to remove a publisher.
$ pkg unset-publisher devtool