Go to main content

Creating Package Repositories in Oracle® Solaris 11.4

Exit Print View

Updated: November 2018
 
 

How to Clone a Local IPS Package Repository

This procedure assumes that you are creating new duplicate repositories. If you are updating duplicate repositories that already exist, use the How to Update a Cloned Local IPS Package Repository procedure.

This procedure is very similar to the How to Explicitly Copy a Repository From the Internet procedure. Some of the steps in this procedure are abbreviated. For more detail, see How to Explicitly Copy a Repository From the Internet.

Before You Begin

Make sure that the repository that will be the source for the clone repositories is current. If necessary, use the How to Update a Local IPS Package Repository procedure to update the source repository before you create the clone repositories.

  1. Create a ZFS file system for the new clone repository.

    Create the repository in a shared location. Set atime to off when you create the repository file system. Consider setting the compression property. See Best Practices for Creating and Using Local IPS Package Repositories.

    If other repositories exist on the same system as this clone repository, you might need to use a different ZFS filesystem name.

    $ zfs create -o atime=off rpool/VARSHARE/pkgrepos
    $ zfs create rpool/VARSHARE/pkgrepos/solaris
  2. Create the required repository infrastructure.

    Create the required IPS repository infrastructure so that you can copy the source repository.

    $ pkgrepo create /var/share/pkgrepos/solaris
  3. Set the default publisher.
    $ pkgrepo -s /var/share/pkgrepos/solaris set publisher/prefix=solaris
  4. Copy the repository content to the new location.

    Use the pkgrecv command to duplicate the updated source repository to the new clone repository.

    $ pkgrecv -s /net/host1/var/share/pkgrepos/solaris \
    -d /net/host2/var/share/pkgrepos/solaris --clone -p '*'

    The -p option clones content from all publishers, in case content was added from a new publisher when the source repository was updated. See the pkgrecv(1) man page for information about the --clone option.

    If the pkgrecv operation is interrupted, follow the instructions in Resuming an Interrupted Package Receive.

  5. Verify the new repository content.

    Use the info, list, and verify subcommands of the pkgrepo command to check that the repository has been copied correctly. If the pkgrepo verify command reports errors, try using the pkgrepo fix command to fix the errors. See the pkgrepo(1) man page for more information.

  6. Snapshot the new repository.
    $ zfs snapshot rpool/VARSHARE/pkgrepos/solaris@sol-11_3_19
  7. Restart the SMF service.

    If you are providing the repository through an HTTP interface, restart the SMF service. Be sure to specify the appropriate service instance when you restart the service.

See Also

If you are providing the repository through an HTTP interface, see the following related documentation: