Adding Publishers

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.example.com/release/ devtool

Example 5-2 Import Publisher Configuration

Use the -p option to retrieve publisher configuration information from the specified repository URI.

$ pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F http://pkg.oracle.com/solaris/release/
$ pkgrepo -s /var/share/pkgrepos/myrepo/ info
PUBLISHER     PACKAGES STATUS           UPDATED
site          7        online           2018-04-14T18:32:46.854674Z
solaris       6143     online           2018-04-15T00:45:52.227891Z
solarisstudio 112      online           2018-04-12T19:29:52.173011Z

If a publisher is specified, then only the matching publisher is added or updated.

$ pkg set-publisher -p /var/share/pkgrepos/myrepo site
$ pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F http://pkg.oracle.com/solaris/release/
site                        origin   online F file:///var/share/pkgrepos/myrepo/

If no publisher is specified, all publishers are added or updated as appropriate.

$ pkg set-publisher -p /var/share/pkgrepos/myrepo
  Updated publisher(s): solaris
$ pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F file:///var/share/pkgrepos/myrepo/
solaris                     origin   online F http://pkg.oracle.com/solaris/release/
site                        origin   online F file:///var/share/pkgrepos/myrepo/
solarisstudio               origin   online F file:///var/share/pkgrepos/myrepo/