Make sure you have a current snapshot of the repository to be updated.
$ zfs list -t all -r rpool/export/IPSpkgrepos/Solaris NAME USED AVAIL REFER MOUNTPOINT rpool/export/IPSpkgrepos/Solaris 17.6G 78.4G 34K /export/IPSpkgrepos/Solaris rpool/export/IPSpkgrepos/Solaris@initial 0 - 17.6G -
If you already have a snapshot of the repository, use the zfs diff command to check whether the snapshot is the same as the repository dataset.
$ zfs diff rpool/export/IPSpkgrepos/Solaris@initial $
If the zfs diff command produces no output, then the snapshot is the same as its parent dataset, and you can use that snapshot for the update.
If the zfs diff command produces output, or if you do not have a snapshot of the repository, then take a new snapshot as shown in Step 6 in How to Explicitly Copy a Repository From the Internet. Use this new snapshot for the update.
Clone the repository snapshot to create a copy of the repository that you can update.
$ zfs clone rpool/export/IPSpkgrepos/Solaris@initial rpool/export/IPSpkgrepos/Solaris_tmp $ zfs list -r rpool/export/IPSpkgrepos/Solaris/ NAME USED AVAIL REFER MOUNTPOINT rpool/export/IPSpkgrepos/Solaris 17.6G 78.4G 34K /export/IPSpkgrepos/Solaris rpool/export/IPSpkgrepos/Solaris@initial 0 - 17.6G - rpool/export/IPSpkgrepos/Solaris_tmp 76K 78.4G 17.6G /export/IPSpkgrepos/Solaris_tmp
Just as you created the original repository either from a file or from an HTTP location, you can update your repository either from a file or from an HTTP location.
See Example 2–2. If the specified destination already contains a package repository, the content of the zip file is added to the content of the existing repository.
$ mount -F hsfs ./sol-11_2-incr-repo.iso /mnt
Use either rsync or tar as shown in How to Copy a Repository From an iso File.
$ rsync -aP /mnt/repo/ /export/IPSpkgrepos/Solaris_tmp
Copy content from another repository to the repository clone. If you are copying from a secure site, ensure that the required SSL certificate and key are installed, and specify the required certificate and key options.
$ pkgrecv -s https://pkg.oracle.com/solaris/support \ -d /export/IPSpkgrepos/Solaris_tmp \ --key /path-to-ssl_key --cert /path-to-ssl_cert '*'
See the pkgrecv(1) man page for more information about the pkgrecv command. Only packages that have changed are updated, so the time to update your repository can be much less than the time to populate the original repository. See the performance tips in Performance Considerations for Copying Repositories.
If the pkgrecv operation is interrupted, follow the instructions in Resuming an Interrupted Package Receive.
$ svcadm disable -st pkg/server:solaris $ zfs promote rpool/export/IPSpkgrepos/Solaris_tmp $ zfs rename rpool/export/IPSpkgrepos/Solaris rpool/export/IPSpkgrepos/Solaris_old $ zfs rename rpool/export/IPSpkgrepos/Solaris_tmp rpool/export/IPSpkgrepos/Solaris
See the svcadm(1M) man page for more information about the svcadm command.
Use the pkgrepo verify command to verify the updated repository. See the pkgrepo(1) man page for more information about the pkgrepo verify and pkgrepo fix commands.
Catalog any new packages found in the newly updated repository and update all search indexes.
$ pkgrepo refresh -s rpool/export/IPSpkgrepos/Solaris
$ zfs snapshot rpool/export/IPSpkgrepos/Solaris@S11U2SRU1
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.
$ svcadm restart pkg/server:solaris
When you are satisfied that your updated repository is working correctly, you can remove the old repository.
$ zfs destroy rpool/export/IPSpkgrepos/Solaris_old