Copying and Creating Package Repositories in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

How to Explicitly Copy a Repository From the Internet

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

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

    $ zfs create -o atime=off rpool/export/IPSpkgrepos
    $ zfs create rpool/export/IPSpkgrepos/Solaris
    $ zfs get atime rpool/export/IPSpkgrepos/Solaris
    NAME                              PROPERTY  VALUE  SOURCE
    rpool/export/IPSpkgrepos/Solaris  atime     off    inherited from rpool/export/IPSpkgrepos
  2. Create the required repository infrastructure.

    Create the required pkg(5) repository infrastructure so that you can copy the repository. The image files used in the previous method include the repository infrastructure, so this step is not needed. When you copy repository content using the pkgrecv command as described in this method, you need to create the repository infrastructure and then copy the repository content into that infrastructure. See the pkg(5) and pkgrepo(1) man pages.

    $ pkgrepo create /export/IPSpkgrepos/Solaris
  3. Copy the repository content to the new location.

    Use the pkgrecv command to copy the repository. This operation could affect your network performance. The time required for this operation to complete depends on your network bandwidth and connection speed. See also Performance Considerations for Copying Repositories. If you update this repository later, only the changes are transferred, and the process can take much less time.

    The following command retrieves all versions of all packages from the package repository specified by the -s option to the repository specified by the -d option. 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 \
    --key /path-to-ssl_key --cert /path-to-ssl_cert '*'

    See the pkgrecv (1) man page for information about the -m and --clone options. You should not use the -m latest option for this purpose. Using a repository that is too sparse can result in errors when users attempt to update their images.

  4. 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.

  5. Snapshot the new repository.
    $ zfs snapshot rpool/export/IPSpkgrepos/Solaris@sol-11_2_0