Copying and Creating Package Repositories in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

How to Enable Users to Retrieve Packages Using an HTTP Interface

The package depot server, pkg.depotd, provides network access to the data contained within a package repository. The svc:/application/pkg/server SMF service invokes the pkg.depotd daemon. To enable clients to access the local repository by using HTTP, this procedure shows how to configure the pkg/server service. You could configure the default instance of the service. This procedure shows how to create and configure a new instance.

  1. Create a depot server 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=/export/IPSpkgrepos/Solaris
  3. (Optional) Set the port number.

    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.

    $ svccfg -s pkg/server:solaris setprop pkg/port=81
  4. (Optional) Set other properties.

    For a complete list of pkg/server properties, see the pkg.depotd(1M) 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
  5. Start the repository service.

    Restart the package depot server service.

    $ svcadm refresh pkg/server:solaris
    $ svcadm enable pkg/server:solaris
  6. 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.

  7. Set the publisher origin.

    To enable client systems to get packages from your local file repository, set the origin for the publisher.

    1. Determine the name of the publisher.

      Use the following command to determine the names of publishers in your repository:

      $ pkgrepo info -s /export/IPSpkgrepos/Solaris
      PUBLISHER PACKAGES STATUS           UPDATED
      solaris   4768     online           2014-04-02T18:11:55.640930Z
    2. Check the suitability of this publisher origin.

      To update installed packages, install packages that depend on installed packages, or install a non-global zone, the repository that you set as the publisher origin must contain at least the same software that is installed in the image where you are setting the publisher. The repository can also contain older or newer software, but it must contain the same software that is installed in the image.

      The following command shows that the specified repository is a not suitable publisher origin for this image:

      $ pkg list entire
      NAME (PUBLISHER)      VERSION                   IFO
      entire                0.5.11-0.175.2.0.0.36.0   i--
      $ pkgrepo list -Hs http://pkg.oracle.com/solaris/release entire@0.5.11-0.175.2.0.0.36.0
      pkgrepo list: The following pattern(s) did not match any packages:
              entire@0.5.11-0.175.2.0.0.36.0

      The following command shows that the specified repository is a suitable publisher origin for this image:

      $ pkgrepo list -Hs http://localhost:81/ entire@0.5.11-0.175.2.0.0.36.0
      solaris       entire       0.5.11,5.11-0.175.2.0.0.36.0:20140401T190148Z
    3. Set the publisher origin.

      Set the publisher origin to one of the following values:

      • The pkg/inst_root location.

        $ pkg set-publisher -G '*' -M '*' -g /export/IPSpkgrepos/Solaris/ solaris
      • The pkg/port location.

        $ pkg set-publisher -G '*' -M '*' -g http://localhost:81/ solaris
      -G '*'

      Removes all existing origins for the solaris publisher.

      -M '*'

      Removes all existing mirrors for the solaris publisher.

      -g

      Adds the URI of the newly-created local repository as the new origin for the solaris publisher.

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

    If you reset the publisher origin in other images, perform the suitability test again: Other images might have a different version of software installed and might not be able to use this repository.

See also