Thursday, 4 August 2016

Configuring Repository Server on Solaris 11.3

Local IPS Repositories:

You might want a local IPS repository for the following reasons:
ü  Performance and security: You do not want your client systems to go to the Internet to retrieve new software packages or update existing packages.
ü  Change control:  You want to ensure that you can perform the same installation next year that you perform today. You want to easily control the versions to which systems can be updated.
ü  Custom packages: You want to deliver custom IPS packages.

Steps to creating local repository from ZIP file:

Create the repository in a shared location. Set atime to off when you create the repository file system.
rahim@solaris01:~$ hostname
solaris01
rahim@solaris01:/software$ sudo zfs create -o atime=off rpool/export/IPSpkgrepos
rahim@solaris01:/software$ sudo zfs create rpool/export/IPSpkgrepos/Solaris
rahim@solaris01:/software$ sudo zfs get atime rpool/export/IPSpkgrepos/Solaris

After Creating IPS Package repo pool we need to execute the following script to unpacks and installs Solaris IPS repository.
                                Unzip the IPSRepository  and change the permission of  install-repo.ksh script.

rahim@solaris01:/software$ sudo chmod  +x  install-repo.ksh
 After that we need to execute this script to create a local repo.
rahim@solaris01:/software$ sudo ./install-repo.ksh -d /export/IPSpkgrepos/Solaris -c -v -I
Using sol-11_3-repo download.
IPS repository exists at destination /export/IPSpkgrepos/Solaris
Current version: 0.175.3.1.0.5.0
Do you want to add to this repository? (y/n)[n]: y

Comparing checksums of downloaded files...done. Checksums match.

Uncompressing sol-11_3-repo_1of5.zip...done.
Uncompressing sol-11_3-repo_2of5.zip...done.
Uncompressing sol-11_3-repo_3of5.zip...done.
Uncompressing sol-11_3-repo_4of5.zip...done.
Uncompressing sol-11_3-repo_5of5.zip...done.
Repository can be found in /export/IPSpkgrepos/Solaris.
Initiating repository rebuild.
Initiating repository verification.
Scanning repository (this could take some time)
Building ISO image...done.
ISO image can be found at:
/software/sol-11_3-repo.iso
Instructions for using the ISO image can be found at:
/export/IPSpkgrepos/Solaris/README-repo-iso.txt
rahim@solaris01:/software$

Note:  Here prefix C,V,I  is optional .
-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_3-repo default: name found in directory
-c        = compare checksums of downloaded zip files
-v        = verify repo after unzipping
-I        = create an ISO image
-y        = add to existing repository without prompting for yes or no. Use
            with caution.

Configure Publisher for accessing Local Repo:

First we need to set a publisher to access local repo.
rahim@solaris01:/software$  pkg set-publisher -p /export/IPSpkgrepos/Solaris

After setting our local Publisher we can check it by the following command.
rahim@solaris01:/software$ sudo pkg publisher solaris

            Publisher: solaris
                Alias:
           Origin URI: file:///export/IPSpkgrepos/Solaris/
              SSL Key: None
             SSL Cert: None
           Origin URI: http://pkg.oracle.com/solaris/release/
              SSL Key: None
             SSL Cert: None
          Client UUID: f07e3b54-6c3f-11e5-befb-7f447de68cea
      Catalog Updated: October  6, 2015 02:41:00 PM
              Enabled: Yes
Here we find two publisher  (http://pkg.oracle.com/solaris/release/ -- This is default repo for solaris OS) and  ( file:///export/IPSpkgrepos/Solaris/ -- This is configured repo for our Local repo.).
Now, if we don’t erase the default repo from the Publisher we can face the following error during install any packages.
rahim@solaris01:/software$ sudo pkg install SUNWxwfnt
Password:
Refreshing catalog 1/1 solaris
Refreshing catalog 1/1 solaris
Refreshing catalog 1/1 solaris
pkg: 0/1 catalogs successfully updated:
  
Framework error: code: 6 reason: Couldn't resolve host 'pkg.oracle.com'
URL: 'http://pkg.oracle.com/solaris/release/versions/0/'  

To avoid this error we will follow the following steps:
rahim@solaris01:$ sudo pkg set-publisher --disable solaris 
rahim@solaris01:$ sudo pkg unset-publisher solaris
 Now we will set our new publisher which is our repos directory. 

rahim@solaris01:/software$  pkg set-publisher -p /export/IPSpkgrepos/Solaris

Using the repository data:

Once the repository image has been made available, whether by mounting an image or copying the data to a specific location, it can be served to clients using pkg.depotd(1M). Before doing so, you will need to alter the provided repository configuration template to match your environment. First, configure pkg.depotd(1M) using SMF (where <data_source> is the full path to where the 'repo' directory is located, such as '/mnt' or <destination> from the examples in section 2.1):
rahim@s$ svccfg -s application/pkg/server setprop  pkg/inst_root=/export/IPSpkgrepos/Solaris

rahim@solaris01:/software$ svccfg -s application/pkg/server setprop pkg/readonly=true

No comments:

  Oracle 21c Cluster Setup & DB Creation on OEL-8.4 using Virtual-box       Moto: This document is created on traditional way to Insta...