Thursday, April 3, 2014

Creating IPS repository on Solaris 11

Oracle has completely changed patching and packaging system on Solaris 11, now it's call as a (IPS)Image packaging system, we can install, update and search packages from repository locally or remotely.

We can design our repository one of the following method:

1. Local repository (server it self)
2. Remote repository in Internal network (with in our local network)
3. Internet(online)repository (http://pkg.oracle.com/solaris/release/)

Some of the key advantages of IPS - Image packaging system:

1. It will check and pickup dependency package automatically while installing any packages
2. It will creates automatically backup boot environment when demand
3. It will allows you to easily grep the information about packages like query ,list,update, install, uninstall the software packages.

Let's describe the steps to setup local repository:

1) Download latest repo from oracle website
2) Usually it is two parts ISO image, we have to combine it together

Setting up a Local IPS repository:

Combine both downloaded repo files together:
root@infravm:/hgfs/Solaris# cat sol-11_1-repo-full.iso-a sol-11_1-repo-full.iso-b > sol-11_1-repo-full.iso
root@infravm:/hgfs/Solaris#
Mount the ISO image as a /mnt:
root@infravm:/# mount -F hsfs /mnt/hgfs/Solaris/sol-11-repo-full.iso /mnt
root@infravm:/# df -h /mnt
Filesystem        Size   Used  Available Capacity  Mounted on
/mnt/hgfs/Solaris/sol-11_1-repo-full.iso
                  6.8G   6.8G         0K   100%    /mnt
root@infravm:/#
Here actually I did not created dedicated files system but if you create separate pool / FS it will give you the good performance and space utilization.
Copy all the files from /mnt/repo/ to our local directory /solrepo/:
root@infravm:/# mkdir /solrepo
root@infravm:/# rsync -aP /mnt/repo/  /solrepo/
sending incremental file list
created directory /solrepo
./
pkg5.repository
         242 100%    0.00kB/s    0:00:00
         242 100%    0.00kB/s    0:00:00 (xfer#1, to-check=1464/1466)
publisher/
publisher/solaris/
publisher/solaris/catalog/
publisher/solaris/catalog/catalog.attrs
         606 100%  295.90kB/s    0:00:00
         606 100%  295.90kB/s    0:00:00 (xfer#2, to-check=1455/1466)
publisher/solaris/catalog/catalog.base.C
       32768   5%    1.95MB/s    0:00:00
      619178 100%   16.87MB/s    0:00:00 (xfer#3, to-check=1454/1466)
publisher/solaris/catalog/catalog.dependency.C
       32768   1%  711.11kB/s    0:00:03
     2581594 100%   17.22MB/s    0:00:00 (xfer#4, to-check=1453/1466)
publisher/solaris/catalog/catalog.summary.C
       32768   1%  209.15kB/s    0:00:07
     1698356 100%    7.57MB/s    0:00:00 (xfer#5, to-check=1452/1466)
publisher/solaris/tmp/lock
           0 100%    0.00kB/s    0:00:00 (xfer#315831, to-check=0/320497)
publisher/solaris/trans/

sent 6932390502 bytes  received 6019468 bytes  6636451.43 bytes/sec
total size is 6903440144  speedup is 0.99
root@infravm:/#
Umount ISO image file /mnt:
root@infravm:/# umount /mnt
root@infravm:/#
Check the repo/publisher status:
root@infravm:/# pkg publisher
PUBLISHER       TYPE     STATUS P LOCATION
solaris         origin   online F http://pkg.oracle.com/solaris/release/
root@infravm:/#
Unsetup the default publisher / repo:
root@infravm:/# pkg unset-publisher solaris
root@infravm:/#
Check the repo/publisher status:
root@infravm:/# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
root@infravm:/#
Setup local repo / publisher :
root@infravm:/# pkg set-publisher -g file:///solrepo/ solaris

Refreshing catalog 1/1 solaris
Refreshing catalog 1/1 solaris
Refreshing catalog 1/1 solaris
Caching catalogs ...
root@infravm:/#
Check the local repo/publisher status:
root@infravm:/# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F file:///solrepo/
root@infravm:/#
Check the status of the local repo:
root@infravm:/# pkgrepo info -s /solrepo
PUBLISHER PACKAGES STATUS           UPDATED
solaris   4401     online           2012-09-27T22:22:59.530981Z
root@infravm:/#
To see all the packages in the repository:
root@infravm:/# pkg search -p -s file:///solrepo/ '*'
PACKAGE                                                                                   PUBLISHER
pkg:/BRCMbnx@0.5.11-0.133                                     solaris
pkg:/BRCMbnxe@0.5.11-0.133                                    solaris
pkg:/CPQary3@0.5.11-0.133                                     solaris
pkg:/FSWfontconfig-devel-docs@0.5.11-0.130                    solaris
pkg:/FSWxorg-client-docs@0.5.11-0.130                         solaris
pkg:/FSWxorg-client-programs@0.5.11-0.130                     solaris
pkg:/FSWxorg-clientlibs@0.5.11-0.130                          solaris
pkg:/FSWxorg-data@0.5.11-0.130                                solaris
root@infravm:/#
To see particular packages in the repository:
root@infravm:/# pkg search -s file:///solrepo solaris-desktop
INDEX      ACTION VALUE                                PACKAGE
pkg.fmri   set    solaris/group/system/solaris-desktop pkg:/group/system/solaris-desktop@0.5.11-0.175.1.0.0.24.3
root@infravm:/#
Install a Package:
root@infravm:~# pkg install solaris-desktop
           Packages to install: 370
       Create boot environment:  No
Create backup boot environment: Yes
            Services to change:  14

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                            370/370   53216/53216  547.3/547.3    0B/s

PHASE                                          ITEMS
Installing new actions                   84196/85615
command output was:
------------------------------------------------------------
drvconfig: modctl failed to add major number binding.
------------------------------------------------------------
Installing new actions                   85615/85615
Updating package state database                 Done
Updating image state                            Done
Creating fast lookup database                   Done
root@infravm:~#
Search for a Package:
root@infravm:/# pkg search  Web browser
INDEX       ACTION VALUE                            PACKAGE
pkg.summary set    Mozilla Firefox Web browser                                     pkg:/web/browser/firefox@10.0.6-0.175.1.0.0.22.0
pkg.summary set    Multi User Desktop optimization for Mozilla Firefox Web browser pkg:/web/browser/firefox/multi-user-desktop@10.0.6-0.175.1.0.0.22.0
pkg.summary set    A text-based web browser                                        pkg:/web/browser/w3m@0.5.2-0.175.0.0.0.0.0
pkg.summary set    Text based web browser                                          pkg:/web/browser/links@1.0.3-0.175.1.0.0.24.0
pkg.summary set    Text-mode web browser                                           pkg:/web/browser/lynx@2.8.7-0.175.0.0.0.0.0
root@infravm:/#
Search for a File:
root@infravm:/# pkg search -o path,pkg.name -l /usr/bin/vim
PATH        PKG.NAME
usr/bin/vim editor/vim/vim-core
root@infravm:/#
Search for Packages that Depend on the Specified:
root@infravm:~# pkg search -l depend::editor/vim
INDEX       ACTION VALUE                          PACKAGE
group       depend editor/vim                     pkg:/group/system/solaris-desktop@0.5.11-0.175.1.0.0.24.3
incorporate depend pkg:/editor/vim@7.3.600-0.175.1.0.0.24.0 pkg:/consolidation/userland/userland-incorporation@0.5.11-0.175.1.0.0.24.0
optional    depend editor/vim@7.3.600             pkg:/editor/vim/vim-core@7.3.600-0.175.1.0.0.24.0
require     depend editor/vim@7.3.600             pkg:/editor/gvim@7.3.600-0.175.1.0.0.24.0
root@infravm:~#
I will write more article about Solaris11 soon... 

Thank you for reading this article.

Tuesday, April 1, 2014

Install / Enable GUI desktop on Solaris 11 x86 platform

By default, the soalris11 text based installation will not install complete package. It will install minimum / default packages. If you want to use GUI desktop, we have to install desktop GUI package from the IPS repository. 

We can install these package from online if you have a internet connection or if you have a local repository then you can install those packages from there. 

Generally Solaris11 will pickup all the dependency packages automatically while installing. In my environment I have configured local repository so I am installing from there. 

This installation will requires a reboot of the system to enable GUI desktop. 

Basically in solaris11 by default it will creates a backup Boot environment depend on the package requirement, for our GUI installation it creates a backup Boot environment and it can be revert back any time.


Installation Steps:
To check IPS repository info:
root@infravm:/# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F file:///solrepo/
root@infravm:/#

Check whether this package is available in local repository:
root@infravm:~# pkg list -g ///solrepo/ | grep -i solaris-desktop
group/system/solaris-desktop                      0.5.11-0.175.1.0.0.24.3    i--
root@infravm:/#
Check this package installed or not :
root@infravm:~# pkg list | grep -i  solaris-desktop
root@infravm:~# pkg info -r solaris-desktop
          Name: group/system/solaris-desktop
       Summary: Oracle Solaris Desktop
   Description: Provides an Oracle Solaris desktop environment
      Category: Meta Packages/Group Packages
         State: Not installed
     Publisher: solaris
       Version: 0.5.11
 Build Release: 5.11
        Branch: 0.175.1.0.0.24.3
Packaging Date: September 19, 2012 06:53:17 PM
          Size: 5.46 kB
          FMRI: pkg://solaris/group/system/solaris-desktop@0.5.11,5.11-0.175.1.0.0.24.3:20120919T185317Z
root@infravm:/#
Installing solaris-desktop package:
root@infravm:~# pkg install solaris-desktop
           Packages to install: 370
       Create boot environment:  No
Create backup boot environment: Yes
            Services to change:  14

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                            370/370   53216/53216  547.3/547.3    0B/s

PHASE                                          ITEMS
Installing new actions                   84196/85615
command output was:
------------------------------------------------------------
drvconfig: modctl failed to add major number binding.
------------------------------------------------------------
Installing new actions                   85615/85615
Updating package state database                 Done
Updating image state                            Done
Creating fast lookup database                   Done
root@infravm:~#
This Installation creates a BBE (Backup Boot Environment).
To check the BE details:
root@infravm:~# beadm list
BE               Active Mountpoint Space  Policy Created
--               ------ ---------- -----  ------ -------
solaris          NR     /          11.94G static 2014-03-29 02:46
solaris-backup-1 -      -          95.0K  static 2014-03-31 22:45
root@infravm:~#
After reboot server came up with GUI desktop:
root@infravm:~# shutdown -g0 -i6 -y

Shutdown started.    Monday, March 31, 2014 11:32:50 PM IST

Changing to init state 6 - please wait
Broadcast Message from root (pts/2) on infravm Mon Mar 31 23:32:50...
THE SYSTEM infravm IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged
root@infravm:~#