Go to main content

Creating Package Repositories in Oracle® Solaris 11.4

Exit Print View

Updated: May 2020
 
 

How to Copy a Repository From an iso File

  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. Consider setting the compression property. See Best Practices for Creating and Using Local IPS Package Repositories.

    $ zfs create -o atime=off rpool/VARSHARE/pkgrepos
    $ zfs create rpool/VARSHARE/pkgrepos/solaris
    $ zfs get atime rpool/VARSHARE/pkgrepos/solaris
    NAME                             PROPERTY  VALUE  SOURCE
    rpool/VARSHARE/pkgrepos/solaris  atime     off    inherited from rpool/VARSHARE/pkgrepos
  2. Get the package repository image files.

    Create an .iso file from the repository .zip files using the -I option as described in Example 1, Creating a New Repository From a zip File.

  3. Mount the image file.

    Mount the repository .iso file to access the content.

    $ mount -F hsfs /path/sol-11_3-repo.iso /mnt

    To avoid the need to remount the .iso image each time the repository server system restarts, copy the repository file content as described in the next step.

  4. Copy the repository content to the new location.

    To increase the performance of repository accesses and to avoid the need to remount the .iso image each time the system restarts, copy the repository files from /mnt/repo/ to a ZFS file system. You can do this copy with the rsync command or with the tar command.

    • Use the rsync command.

      If you use the rsync command, be sure to specify /mnt/repo/ (including the trailing slash character) and not /mnt/repo to copy the files and subdirectories in the repo directory. See the rsync(1) man page.

      $ rsync -aP /mnt/repo/ /var/share/pkgrepos/solaris
    • Use the tar command.

      Using the tar command as shown in the following example can be a faster way to copy the repository from the mounted file system to the repository ZFS file system.

      $ cd /mnt/repo; tar cf - . | (cd /var/share/pkgrepos/solaris; tar xfp -)
  5. Unmount the image file.

    Make sure you are not still in the /mnt directory.

    $ umount /mnt
  6. 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.

  7. Snapshot the new repository.
    $ zfs snapshot rpool/VARSHARE/pkgrepos/solaris@sol-11_3_0