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
Download the Oracle Solaris IPS package repository .zip files from the same location where you downloaded the system installation image, or locate the repository DVD in the media packet. Along with the .zip files, download the install-repo.ksh script, and the .txt files (the README and checksum files).
$ ls install-repo.ksh sol-11_2-ga-repo-3of4.zip README-zipped-repo.txt sol-11_2-ga-repo-4of4.zip sol-11_2-ga-repo-1of4.zip sol-11_2-ga-repo.txt sol-11_2-ga-repo-2of4.zip
$ chmod +x install-repo.ksh
The repository installation script, install-repo.ksh, uncompresses each repository .zip file into the specified directory. The script optionally performs the following additional tasks:
Verify checksums of the downloaded .zip files. If you do not specify the -c option to verify checksums, verify the checksums manually before you run the repository installation script. Run the following digest command, and compare the output with the appropriate checksum from the .md5 file:
$ digest -a md5 file
Add the repository content to existing content if the specified destination already contains a repository.
Verify the final repository. If you do not specify the -v option to verify the repository, use the info, list, and verify subcommands of the pkgrepo command to verify the repository after you run the repository installation script.
Create an ISO image file for mounting and distribution. If you use the -I option to create an .iso file, the .iso file and the README file that explains how to use the .iso file are in specified destination directory.
If you did not specify the -v option in the previous step, 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/export/IPSpkgrepos/Solaris@sol-11_2_0
In this example, no repository exists until the zip files are unpacked. The script can take the following options:
Optional. Specifies the full path to the directory where the .zip files are located. Default: The current directory.
Required. Specifies the full path to the directory where you want the repository.
Optional. Specifies the files to use to populate this repository. The source directory could contain multiple sets of .zip files. Default: The newest image available in the source directory.
Optional. Compares the checksums of the .zip files with the checksums in the specified file. If you specify -c with no argument, the default file used is the .md5 file for the -i image in the source directory.
Optional. Verifies the final repository.
Optional. Creates an ISO image of the repository in the source directory. Also leaves a mkiso.log log file in the source directory.
Optional. Displays a usage message.
$ ./install-repo.ksh -d /export/IPSpkgrepos/Solaris -c -v -I Comparing checksums of downloaded files...done. Checksums match. Uncompressing sol-11_2-ga-repo-1of4.zip...done. Uncompressing sol-11_2-ga-repo-2of4.zip...done. Uncompressing sol-11_2-ga-repo-3of4.zip...done. Uncompressing sol-11_2-ga-repo-4of4.zip...done. Repository can be found in /export/IPSpkgrepos/Solaris. Initiating repository verification. Building ISO image...done. ISO image and instructions for using the ISO image are at: /tank/downloads/sol-11_2-ga-repo.iso /tank/downloads/README-repo-iso.txt $ ls /export/IPSpkgrepos/Solaris COPYRIGHT NOTICES pkg5.repository publisher README-iso.txt
The repository rebuild and verification can take some time, but the repository content is retrievable after you get the “Repository can be found in” message.
Example 2-2 Adding to an Existing Repository From a zip FileIn this example, the content of the repository zip files is added to the content in an existing package repository.
$ pkgrepo -s /export/IPSpkgrepos/Solaris info PUBLISHER PACKAGES STATUS UPDATED solaris 4764 online 2014-03-18T05:30:57.221021Z $ ./install-repo.ksh -d /export/IPSpkgrepos/Solaris -c -v -I IPS repository exists at destination /export/IPSpkgrepos/Solaris Current version: 0.175.2.0.0.35.0 Do you want to add to this repository? (y/n) y Comparing checksums of downloaded files...done. Checksums match. Uncompressing sol-11_2-ga-repo-1of4.zip...done. Uncompressing sol-11_2-ga-repo-2of4.zip...done. Uncompressing sol-11_2-ga-repo-3of4.zip...done. Uncompressing sol-11_2-ga-repo-4of4.zip...done. Repository can be found in /export/IPSpkgrepos/Solaris. Initiating repository rebuild. Initiating repository verification. Building ISO image...done. ISO image and instructions for using the ISO image are at: /tank/downloads/sol-11_2-ga-repo.iso /tank/downloads/README-repo-iso.txt $ pkgrepo -s /export/IPSpkgrepos/Solaris info PUBLISHER PACKAGES STATUS UPDATED solaris 4768 online 2014-06-02T18:11:55.640930Z