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.
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
Create the required IPS repository infrastructure so that you can copy the source repository.
$ pkgrepo create /var/share/pkgrepos/solaris
$ pkgrepo -s /var/share/pkgrepos/solaris set publisher/prefix=solaris
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.
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.
$ zfs snapshot rpool/VARSHARE/pkgrepos/solaris@sol-11_3_19
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:
Serving Multiple Repositories Using Web Server Access describes how to serve multiple repositories using multiple pkg.depotd daemons running on different ports.
Multiple Repositories Under One Domain describes how to run multiple repositories under one domain name with different prefixes.