Monday, January 26, 2015

Solaris 11.2: create IPS repository


Image packaging system(IPS) repository is one of the important element from Solaris 11 onwards. For an example, to install any new package or install the zones, you need IPS repository.In Solaris 11.2 release, oracle automated the IPS little bit by providing the script to merge the piece  of repo files and performing the checksum automatically. We just need to download the repo files,md5checkum  and script in one location and follow the below article to create a IPS repository locally.
We can categories repositories as,
  1. Oracle Release repository
  2. Oracle Support Repository
  3. Oracle Local repository.

  • Oracle Release repository requires internet connection and this repo has all the new updates.It will use http connection.

UA_SOL11# pkg publisher
PUBLISHER    TYPE    STATUS    URI
solaris        origin    online    http://pkg.oracle.com/solaris/release/

  • Oracle Support repository also requires internet connection and this repo is available only for customers who availed oracle support.It will use secure http connection.

UA-SOL11#pkg publisher
PUBLISHER TYPE STATUS P LOCATION
solaris origin online F https://pkg.oracle.com/solaris/support/
UA-SOL11#


  • Oracle local repository will be created on the local systems using the downloaded repository files from oracle.Here we are going to see how  to create a local repository using oracle's automated script .
  1. Download the repository files from oracle website.
  2. Keep all the downloaded files in same directory of solaris 11.1/11.2 server .  Make sure you have re-named the md5sum file like below.

UA-CLOUD@root#ls -lrt
total 14373947
-rwx------ 1 root root 1771800121 Aug 9 08:24 sol-11_2-repo-1of4.zip
-rwx------ 1 root root 1889867782 Aug 9 11:20 sol-11_2-repo-2of4.zip
-rwx------ 1 root root 1902167161 Aug 9 22:34 sol-11_2-repo-3of4.zip
-rwx------ 1 root root 1790358735 Aug 10 00:16 sol-11_2-repo-4of4.zip
-rwx------ 1 root root 5594 Aug 10 20:16 install-repo.ksh
-rwx------ 1 root root 228 Aug 10 20:17 sol-11_2-repo-md5sums.txt
drwxr-xr-x 2 root root 2 Aug 10 20:40 repo
UA-CLOUD@root#

  1. Set the executable bit for install-repo.ksh and execute like below. "-v" option will take more time to complete since its going to verify each package. If you don't want to verify, just skip it  and that will save lot of time.

UA-CLOUD@root#./install-repo.ksh -d /UAIPS/repo/ -v -c
Comparing checksums of downloaded files...done. Checksums match.

Uncompressing sol-11_2-repo-1of4.zip...done.
Uncompressing sol-11_2-repo-2of4.zip...done.
Uncompressing sol-11_2-repo-3of4.zip...done.
Uncompressing sol-11_2-repo-4of4.zip...done.
Repository can be found in /UAIPS/repo/.
Initiating repository verification.
UA-CLOUD@root#

SCRIPT USAGE:
This script provides the option to create ISO repo as well. To create ISO, just give option  "-I" in the above command.

USAGE:
install-repo.ksh -d dest [-s zipsrc] [-i image-name] [-c] [-v] [-I]
-d dest = destination directory to hold repository
-s zipsrc = full path to directory holding zip files. default: current
directory
-i image = name of image: e.g. sol-11_2. default: name found in directory
-c = compare checksums of downloaded zip files
-v = verify repo after unzipping
-I = create an ISO image

1. Navigate to the repo directory and see the newly created repository files.

UA-CLOUD@root#cd /UAIPS/repo
UA-CLOUD@root#ls -lrt
total 31
-rw-r--r-- 1 root root 347 Jun 25 05:25 pkg5.repository
-rwxr-xr-x 1 root root 5970 Jun 25 10:15 README-repo-iso.txt
-rw-r--r-- 1 root root 1625 Jun 25 10:15 NOTICES
-rw-r--r-- 1 root root 3246 Jun 25 10:15 COPYRIGHT
drwxr-xr-x 3 root root 3 Aug 10 20:41 publisher
UA-CLOUD@root#

2. Check the current publisher.

UA-CLOUD@root#pkg publisher
PUBLISHER TYPE STATUS P LOCATION
solaris origin online F http://pkg.oracle.com/solaris/release/
UA-CLOUD@root#

3. Set new publisher.  Path will be same as what we have given in step 3.

UA-CLOUD@root#pkg set-publisher -G '*' -M '*' -g file:///UAIPS/repo solaris
UA-CLOUD@root#pkg publisher
PUBLISHER TYPE STATUS P LOCATION
solaris origin online F file:///UAIPS/repo/
UA-CLOUD@root#

4. Make sure the system repository service is pointing to the local repo. If not just edit the SMF.

# svccfg -s application/pkg/server setprop pkg/inst_root=/UAIPS/repo

Check your work:

# svcprop -p pkg/inst_root application/pkg/server

Reload the pkg.depotd repository service.

# svcadm refresh application/pkg/server

We have successfully deployed the oracle Solaris 11.2 repository locally.

No comments:

Post a Comment