Friday, March 17, 2017

Solaris 11 - Image Packaging System Basics (IPS)

Solaris 11 - Image Packaging System Basics (IPS)

Last Post we saw how to configure local repository on Solaris 11 server. In this post we will see the brief of New IPS features and troubleshoot methods, Installing and uninstalling the packages, checking the packages contents and package dependencies and package manifest basics and understanding the packages components.

Basics of Repository :
  • Administrators can suggest whether we required Oracle repository or Local repository depends on environment requirements.
  • Oracle Solaris 11 installations will come up with default publisher http://pkg.oracle.com/solaris/release which supplies all packages from the oracle release repository.
  • Administrators can install new software packages, search the content of package or mirror the contents of that repository locally.
  • Oracle Solaris 11 having many IPS pkg command which query the system with using option "list, info, content, search, history can be performed by users.
Basics of Packages FMRI:
below output you can understand the brief about the structure of package FMRI (Fault Managed Resources Identifier).






Listing installed Packages in that server
root@unixrock:~# pkg list |more
NAME (PUBLISHER)                                  VERSION                    IFO
archiver/gnu-tar                                  1.26-0.175.1.0.0.24.0      i--
audio/audio-utilities                             0.5.11-0.175.1.0.0.24.2    i--
codec/flac                                        1.2.1-0.175.0.0.0.0.0      i--
codec/libtheora                                   1.1.1-0.175.1.0.0.15.0     i--
codec/ogg-vorbis                                  2.30.0-0.175.1.0.0.12.0    i--
codec/speex                                       1.2-0.175.1.0.0.15.0       i--
communication/im/pidgin                           2.10.5-0.175.1.0.0.24.0    i--
compress/bzip2                                    1.0.6-0.175.1.0.0.24.0     i--
compress/gzip                                     1.4-0.175.1.0.0.24.0       i--
compress/p7zip                                    9.20.1-0.175.1.0.0.24.0    i--
compress/unzip                                    6.0-0.175.1.0.0.24.0       i--
compress/xz                                       5.0.1-0.175.1.0.0.24.0     i--
compress/zip                                      3.0-0.175.1.0.0.24.0       i--
---------Few lines are confiscated---------------------------------------------- 
x11/xfontsel                                      1.0.4-0.175.1.0.0.24.1317  i--
x11/xfs                                           1.1.2-0.175.1.0.0.24.1317  i--
x11/xfs/xfs-utilities                             7.7-0.175.1.0.0.24.1317    i--
x11/xkill                                         1.0.3-0.175.1.0.0.24.1317  i--
x11/xlock                                         0.5.11-0.175.1.0.0.24.1317 i--
x11/xmag                                          1.0.4-0.175.1.0.0.24.1317  i--
x11/xvidtune                                      1.0.2-0.175.1.0.0.24.1317  i--
root@unixrock:~# 
 
Listing the Version information of particular pkg
root@unixrock:~# pkg list diagnostic/tcpdump
NAME (PUBLISHER)                                  VERSION                    IFO
diagnostic/tcpdump                                4.1.1-0.175.1.0.0.24.0     i--
root@unixrock:~# 
Checking detailed information about the particular pkg
root@unixrock:~# pkg info diagnostic/tcpdump
          Name: diagnostic/tcpdump
       Summary: network traffic sniffer
   Description: A tool for network monitoring and data acquisition
      Category: Applications/Internet
         State: Installed
     Publisher: solaris
       Version: 4.1.1
 Build Release: 5.11
        Branch: 0.175.1.0.0.24.0
Packaging Date: September  4, 2012 05:17:58 PM
          Size: 1.24 MB
          FMRI: pkg://solaris/diagnostic/tcpdump@4.1.1,5.11-0.175.1.0.0.24.0:20120904T171758Z
root@unixrock:~#
 
Checking contents of particular pkg which shows the complete installation path.
root@unixrock:~# pkg contents diagnostic/tcpdump
PATH
usr
usr/sbin
usr/sbin/tcpdump
usr/share
usr/share/man
usr/share/man/man1
usr/share/man/man1/tcpdump.1
root@unixrock:~#
 
Checking the package history for the recent updates and changes.
root@unixrock:~# pkg history
START                    OPERATION                CLIENT             OUTCOME
2012-09-20T01:18:22      set-property             transfer module    Succeeded
2012-09-20T01:18:22      add-publisher            transfer module    Succeeded
2012-09-20T01:18:22      refresh-publishers       transfer module    Succeeded
2012-09-20T01:18:22      image-create             transfer module    Succeeded
2012-09-20T01:18:30      rebuild-image-catalogs   transfer module    Succeeded
2012-09-20T01:18:36      set-property             transfer module    Succeeded
2012-09-20T01:18:37      install                  transfer module    Succeeded
2012-09-20T02:00:12      update-publisher         transfer module    Succeeded
2012-09-20T02:00:12      refresh-publishers       transfer module    Succeeded
2014-09-31T23:37:48      refresh-publishers       pkg                Failed
2014-09-31T23:37:48      update                   pkg                Failed
2014-08-11T21:34:42      refresh-publishers       pkg                Succeeded
 
Checking the all package Integrity
root@unixrock:~# pkg verify
pkg://solaris/desktop/administration/nwam-manager                 55/847 / 
Checking the particular package Integrity
root@unixrock:~# pkg verify diagnostic/tcpdump
root@unixrock:~#
 
Searching particular packages with details
root@unixrock:~# pkg search -l diagnostic/tcpdump
INDEX       ACTION VALUE                                          PACKAGE
group       depend diagnostic/tcpdump                             pkg:/group/system/solaris-desktop@0.5.11-0.175.1.0.0.24.3
incorporate depend pkg:/diagnostic/tcpdump@4.1.1-0.175.1.0.0.24.0 pkg:/consolidation/userland/userland-incorporation@0.5.11-0.175.1.0.0.24.0
pkg.fmri    set    solaris/diagnostic/tcpdump                     pkg:/diagnostic/tcpdump@4.1.1-0.175.1.0.0.24.0
root@unixrock:~#
 
rebuild the repo index whenever search performance is degraded
root@unixrock:~# pkg rebuild-index
PHASE                                          ITEMS
Building new search index                    847/847
root@unixrock:~#
 
Installing the particular package
root@unixrock:~# pkg install diagnostic/tcpdump
           Packages to install:  1
       Create boot environment: No
Create backup boot environment: No

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                                1/1           6/6      0.4/0.4    0B/s

PHASE                                          ITEMS
Installing new actions                         20/20
Updating package state database                 Done
Updating image state                            Done
Creating fast lookup database                   Done
Reading search index                            Done
Updating search index                            1/1
root@unixrock:~#
 
Checking the dependency packages
root@unixrock:~# pkg contents -r -o fmri,type -t depend diagnostic/tcpdump
FMRI                                               TYPE
pkg:/system/library/libpcap@1.1.1-0.175.1.0.0.23.0 require
pkg:/system/library@0.5.11-0.175.1.0.0.23.0        require
root@unixrock:~#
 
Uninstalling the package
root@unixrock:~# pkg uninstall diagnostic/tcpdump
            Packages to remove:  1
       Create boot environment: No
Create backup boot environment: No

PHASE                                          ITEMS
Removing old actions                           14/14
Updating package state database                 Done
Updating package cache                           1/1
Updating image state                            Done
Creating fast lookup database                   Done
Reading search index                            Done
Updating search index                            1/1
root@unixrock:~#
 
Solaris 11 IPS will update your system to latest packages with single command "pkg update". Even though we can execute the command with "-nv" option for a dry run to get an idea about the work which needs to be completed.
root@unixrock:~# pkg update -nv
No updates available for this image.
root@unixrock:~#
Trying to update the particular packages from repo
root@unixrock:~# pkg update diagnostic/tcpdump
No updates available for this image.
root@unixrock:~#
 
List the publisher with local repository
root@unixrock:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F file:///unixrepo/repo/repo/
root@unixrock:~#
root@unixrock:~#
 
Listing the local repository packages
root@unixrock:~# pkgrepo -s /unixrepo/repo/repo/ list|more
PUBLISHER NAME                                          O VERSION
solaris   BRCMbnx                                       r 0.5.11,5.11-0.133:20101027T183107Z
solaris   BRCMbnxe                                      r 0.5.11,5.11-0.133:20101027T183108Z
solaris   CPQary3                                       r 0.5.11,5.11-0.133:20101027T183108Z
solaris   FSWfontconfig-devel-docs                      o 0.5.11,5.11-0.130:20101027T183140Z
solaris   FSWxorg-client-docs                           r 0.5.11,5.11-0.130:20101027T183141Z
solaris   FSWxorg-client-programs                       r 0.5.11,5.11-0.130:20101027T183142Z
solaris   FSWxorg-clientlibs                            r 0.5.11,5.11-0.130:20101027T183142Z
solaris   FSWxorg-data                                  r 0.5.11,5.11-0.130:20101027T183143Z 


Checking the local repository packages status and updated dates
root@unixrock:~# pkgrepo info -s /unixrepo/repo/repo
PUBLISHER PACKAGES STATUS           UPDATED
solaris   4299     online           2014-08-14T17:34:29.002068Z
root@unixrock:~#
Checking the oracle repo packages status and updated dates.
root@unixrock:~# pkgrepo info -s http://pkg.oracle.com/solaris/release/
PUBLISHER PACKAGES STATUS           UPDATED
solaris   4870     online           2014-08-04T15:04:42.642929Z
root@unixrock:~#

Refreshing the local repository whenever its required
root@unixrock:~# pkgrepo refresh -s /unixrepo/repo/repo
Initiating repository refresh. 

Display All Repository Properties
root@unixrock:~# pkgrepo get -s /unixrepo/repo/repo
SECTION    PROPERTY    VALUE
publisher  prefix      solaris
repository description This\ repository\ serves\ a\ copy\ of\ the\ Oracle\ Solaris\ 11\ Build\ 175b\ Package\ Repository.
repository name        Oracle\ Solaris\ 11\ Build\ 175b\ Package\ Repository
repository version     4
root@unixrock:~#

Updating the local repository from Oracle Portal
root@unixrock:~# pkgrecv -s http://pkg.oracle.com/solaris/release -d /unixrepo/repo/repo solaris
Processing packages for publisher solaris ...
Retrieving and evaluating 4870 package(s)...
PROCESS                                         ITEMS    GET (MB)   SEND (MB)
SUNWamt                                        0/2016      0/7768     0/25461

Receiving single package on the local repository from Oracle Portal
root@unixrock:~# pkgrecv -s http://pkg.oracle.com/solaris/release/ -d /unixrepo/repo/repo pkg://solaris/diagnostic/tcpdump@4.1.1,5.11-0.175.1.0.0.24.0:20120904T171758Z
Processing packages for publisher solaris ...
Retrieving and evaluating 1 package(s)...
PROCESS                                         ITEMS    GET (MB)   SEND (MB)
Completed                                         1/1     0.8/0.8     2.2/2.2
root@unixrock:~#

Updating local respository with using latest SRU ( Solaris Repository Update images)
root@unixrock:/# lofiadm -a /var/tmp/sol-11_1_s11_sru11.4b.-x86.iso
/dev/lofi/1
root@unixrock:/# mount -F hsfs /dev/lofi/1 /mnt/repo
root@unixrock:/#
root@unixrock:/# df -h /mnt/repo
Filesystem             Size   Used  Available Capacity  Mounted on
/dev/lofi/1            357M   357M         0K   100%    /mnt/repo
root@unixrock:/#
root@unixrock:/# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F file:///unixrepo/repo/repo/
root@unixrock:/#
root@unixrock:/# pkgrecv -s /mnt/repo/repo -d /unixrepo/repo/repo/ "*"
Processing packages for publisher solaris ...
Retrieving and evaluating 4292 package(s)...
PROCESS                                         ITEMS    GET (MB)   SEND (MB)
Completed                                         1/1     0.0/0.0     0.0/0.0
root@unixrock:/#
root@unixrock:/# pkgrepo rebuild -s /unixrepo/repo/repo/
Initiating repository rebuild.
root@unixrock:/#
root@unixrock:/# svcprop -p pkg/inst_root svc:/application/pkg/server:default
/unixrepo/repo/repo
root@unixrock:/# svcadm restart svc:/application/pkg/server
root@unixrock:/#

Removing the package from local repository
root@unixrock:~# pkgrepo remove -p solaris -s /unixrepo/repo/repo/ pkg://solaris/diagnostic/tcpdump@4.1.1,5.11-0.175.1.0.0.24.0:20120904T171758Z
Removing packages for publisher solaris ...
PHASE                                          ITEMS
Deleting search index                           Done
Updating catalog                                Done
Analyzing removed packages                       1/1
Analyzing repository packages              4619/4619
Removing package manifests                       1/1
root@unixrock:~#

Verifying the package and found ERROR status
root@unixrock:~# pkg verify -v gzip
PACKAGE                                                                 STATUS
pkg://solaris/compress/gzip                                              ERROR
        file: usr/bin/gzip
                Mode: 01600 should be 0555
                Unexpected Exception: Request error: class file/memory mismatch
root@unixrock:~#
root@unixrock:~#

Fixing the package issue.
root@unixrock:~# pkg fix gzip
Verifying: pkg://solaris/compress/gzip                          ERROR
        file: usr/bin/gzip
                Mode: 01600 should be 0555
                Unexpected Exception: Request error: class file/memory mismatch
Created ZFS snapshot: 2014-08-15-17:56:18
Repairing: pkg://solaris/compress/gzip
Creating Plan (Evaluating mediators): -

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                                1/1           1/1      0.1/0.1    0B/s

PHASE                                          ITEMS
Updating modified actions                        1/1
Updating image state                            Done
Creating fast lookup database                   Done
root@unixrock:~#
root@unixrock:~# pkg verify -v gzip
PACKAGE                                                                 STATUS
pkg://solaris/compress/gzip                                                 OK
root@unixrock:~#

Cool !!!! Thanks for reading this post. Please leave your valuable comments and queries, I will get back to you as much I can. 

No comments: