Copying and Creating Package Repositories in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

How to Enable Users to Retrieve Packages Using a File Interface

  1. Configure an NFS share.

    To enable clients to access the local repository by using NFS, create and publish an NFS share.

    $ zfs share -o share.nfs=on rpool/export/IPSpkgrepos%ipsrepo

    See the zfs_share(1M) man page for more information, such as additional share.nfs properties that you could set.

  2. Confirm that the share is published.

    Use one of the following tests to confirm that the share is published:

    • Search for the repository in the shared file system table.
      $ grep repo /etc/dfs/sharetab
      /export/IPSpkgrepos     ipsrepo nfs     sec=sys,rw
    • Determine whether the repository is accessible from a remote system.
      $ dfshares solaris
      RESOURCE                                  SERVER ACCESS  TRANSPORT
         solaris:/export/IPSpkgrepos           solaris  -       -
  3. 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 /export/IPSpkgrepos/Solaris 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.

      Using the repository location and publisher name from the previous steps, run the following command to set the origin for the publisher:

      $ pkg set-publisher -G '*' -M '*' -g /export/IPSpkgrepos/Solaris/ 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. If you reset the publisher origin in images on other systems, use a full path for the -g argument.