Copying and Creating Package Repositories in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014

How to Serve Multiple Repositories From a Single Location

Many of the steps in this procedure are the same as the steps in the previous procedure. See the previous procedure for details.

  1. Create a new depot server instance.
  2. Set the path to the repository.

    Each pkg/server instance that is managed by a particular pkg/depot instance must have a unique pkg/inst_root value.

  3. Check the readonly property for the new instance.

    The default value of the pkg/readonly property is true. If this value has been changed, reset the value to true.

    $ svcprop -p pkg/readonly pkg/server:studio
  4. Set the standalone property for the new instance.

    By default, the value of the pkg/standalone property is true. Any pkg/server instances whose pkg/standalone property is set to false can be served from the same location by a pkg/depot service instance.

    $ svccfg -s pkg/server:studio
    svc:/application/pkg/server:studio> setprop pkg/standalone=false
    svc:/application/pkg/server:studio> refresh
    svc:/application/pkg/server:studio> select solaris
    svc:/application/pkg/server:solaris> setprop pkg/standalone=false
    svc:/application/pkg/server:solaris> refresh
    svc:/application/pkg/server:solaris> exit

    Make sure the value of the pkg/inst_root property is unique for each instance of pkg/server whose pkg/standalone property is set to false.

  5. (Optional) Set the port number for the pkg/depot instance.

    By default, the port number of the svc:/application/pkg/depot:default service is 80. This port number can be the same as the port number for any of the pkg/server instances that will be managed by this pkg/depot instance. To change the port number, set the config/port property of pkg/depot:default.

  6. Restart the pkg/depot instance.
    $ svcadm refresh pkg/depot:default
    $ svcadm restart pkg/depot:default
  7. Test that the repository server is working.

    When users open the http://localhost:80/ location, they see the http://localhost/solaris repository listed with the solaris publisher, and they see the http://localhost/studio repository listed with the solarisstudio publisher.

    If one repository provides packages for multiple publishers, all publishers are listed. For example, users might see the http://localhost/solaris repository listed with the solaris and isvpub publishers.

  8. Set the publisher origin.

    Set the publisher origin to one of the following values:

    • The unique pkg/inst_root location.

      $ pkg set-publisher -G '*' -M '*' -g /export/IPSpkgrepos/SolarisStudio/ \
    • The location defined by the value of config/port plus the pkg/server instance name.

      $ pkg set-publisher -G '*' -M '*' -g http://localhost:80/studio/ solarisstudio

Next Steps

If you change the content of a repository that is managed by a pkg/depot instance, as discussed in Updating Your Local Repository and Customizing Your Local Repository, perform both of the following steps:

  • Run pkgrepo refresh on the repository.

  • Run svcadm restart on the pkg/depot instance.

You can create additional instances of the pkg/depot service where each instance hosts one or more repositories.

To generate a standalone configuration rather than configuring pkg/server and pkg/depot service instances, see the pkg.depot-config(1M) man page.