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.
Use the add subcommand to add a new instance of the pkg/server service named solaris.
$ svccfg -s pkg/server add solaris
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
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
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
Restart the package depot server service.
$ svcadm refresh pkg/server:solaris $ svcadm enable pkg/server:solaris
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.
To enable client systems to get packages from your local file repository, set the origin for 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
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 firstname.lastname@example.org pkgrepo list: The following pattern(s) did not match any packages: email@example.com
The following command shows that the specified repository is a suitable publisher origin for this image:
$ pkgrepo list -Hs http://localhost:81/ firstname.lastname@example.org solaris entire 0.5.11,5.11-0.175.2.0.0.36.0:20140401T190148Z
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
Removes all existing origins for the solaris publisher.
Removes all existing mirrors for the solaris publisher.
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.
Serving Multiple Repositories Using Web Server Access describes how to serve multiple repositories from multiple locations or from a single location.
Multiple Repositories Under One Domain describes how to run multiple repositories under one domain name with different prefixes.
Configuring HTTPS Repository Access describes how to configure secure repository access.