Go to main content

Creating Package Repositories in Oracle® Solaris 11.4

Exit Print View

Updated: May 2020

How to Configure a pkg/server Service Instance

You always need to configure a svc:/application/pkg/server SMF service instance. A pkg/server instance is required to provide the file system location of the repository to either a pkg/depot instance or a manual Apache configuration.

  1. Create a pkg/server depot server instance.

    You could configure the default instance of the pkg/server service. This procedure shows how to create and configure a new instance.

    Use the add subcommand to add a new instance of the pkg/server service named solaris.

    $ svccfg -s pkg/server add solaris
  2. Set the path to the repository.

    Set the path where this instance of the service can find the repository data.

    $ svccfg -s pkg/server:solaris setprop pkg/inst_root=/var/share/pkgrepos/solaris
  3. (Optional) Set other properties.

    For a complete list of pkg/server properties, see the pkg.depotd(8) man page.

    To set multiple service properties, use the following command to edit all of the properties at once. Remember to remove the comment marker (#) from the beginning of any lines that you change.

    $ svccfg -s pkg/server:solaris editprop

    Note -  When the value of the pkg/standalone property is false and the value of the pkg/readonly property is true (see How to Enable Users to Retrieve Packages Using an HTTP Interface), then only the pkg/inst_root property of the pkg/server instance is used. All other configuration comes from properties on the pkg/depot service.

    The following are examples of other properties that you could set:

    • Set the port property.

      Set the port number on which the depot server instance should listen for incoming package requests. By default, pkg.depotd listens for connections on port 80. To change the port, reset the pkg/port property.

    • Increase the threads property value to increase scalability for a small number of clients.

      To increase concurrent client access for a repository served by the pkg.depotd depot server, increase the value of the pkg/threads property.

      The default value of the pkg/threads property is 60. The pkg/threads value is limited by available memory. Allow for 20 threads used per concurrent client. Scaling efficiency peaks at about 20 clients.

      $ svccfg -s pkg/server:solaris setprop pkg/threads=400
  4. Start the repository service.

    Refresh and enable the pkg/server instance.

    $ svcadm refresh pkg/server:solaris
    $ svcadm enable pkg/server:solaris

    If the pkg/server:solaris instance is not online, use the svcs -xvL pkg/server:solaris command to get more information to diagnose and fix the problem.

  5. Test that the repository server is working.

    To determine whether the repository server is working, open a browser window on the localhost location. By default, pkg.depotd listens for connections on port 80. If you have changed the port, open a browser window on the localhost:port_number location.

  6. Set the publisher origin.

    Set the publisher origin to the pkg/port location:

    $ pkg set-publisher -g http://localhost:81/ solaris

    See Configuring Publishers in Updating Systems and Adding Software in Oracle Solaris 11.4 for more information about configuring publishers.

Next Steps

Note -  A pkg/server instance for repository access is suitable for use by a small number of clients. For simultaneous access by a large number of clients, implement a pkg/depot instance. A pkg/depot instance provides much greater scalability than a pkg/server instance. See How to Enable Users to Retrieve Packages Using an HTTP Interface.