Monday, October 15, 2012

HP-UX sw* operations


HP-UX Package install/uninstall/list operations


### Find the available depot on a host

in the local host :

**swlist -i -d @ /var/opt/pkgs/depots/Rel.11.31/apps

In a remote host :

root@MyHPHOST:/hroot# swlist -l depot -s MyHPHOST2 -d /var/opt/pkgs/depots/Rel.11.31/apps
# Initializing...
# Target "MyHPHOST2" has the following depot(s):
  /var/opt/pkgs/depots/Rel.11.23/core
  /var/opt/pkgs/depots/Rel.11.23/apps
  /var/opt/pkgs/depots/Rel.11.31/core
  /var/opt/pkgs/depots/Rel.11.31/apps
  /var/opt/pkgs/depots/Rel.11.11/core
  /var/opt/pkgs/depots/Rel.11.11/apps
  /var/spool/sw
root@MyHPHOST:/hroot#


### Find a specific Package in the depot

root@MyHPHOST:/hroot# swlist -d -l product NMSAP @ MyHPHOST2:/var/opt/pkgs/depots/Rel.11.31/apps
# Initializing...
# Contacting target "MyHPHOST2"...
#
# Target:  MyHPHOST2:/var/opt/pkgs/depots/Rel.11.31/apps
#

  NMSAP         4.0            NetWorker Module for SAP with Oracle
root@MyHPHOST:/hroot#


root@MyHPHOST:/hroot# swlist -d -l product @ MyHPHOST2:/var/opt/pkgs/depots/Rel.11.31/apps | grep NMSAP
  NMSAP                 4.0            NetWorker Module for SAP with Oracle
root@MyHPHOST:/hroot#



### Find the list of files in a specific package

root@MyHPHOST:/hroot# swlist -d -l file NMSAP @ MyHPHOST2:/var/opt/pkgs/depots/Rel.11.31/apps
# Initializing...
# Contacting target "MyHPHOST2"...
#
# Target:  MyHPHOST2:/var/opt/pkgs/depots/Rel.11.31/apps
#

# NMSAP                 4.0            NetWorker Module for SAP with Oracle
# NMSAP.lgto-nmsap      4.0            NetWorker Module for SAP with Oracle
  /etc/init.utl
  /etc/nsrsapsv.cfg
  /etc/nwsldreg.xml
  /opt/networker/bin/backint
  /opt/networker/bin/nsrsapadm
  /opt/networker/bin/nsrsapprobe
  /opt/networker/bin/nsrsapra
  /opt/networker/bin/nsrsaprachild
  /opt/networker/bin/nsrsapsv
  /opt/networker/bin/sapclone
  /opt/networker/bin/sapra.jar
  /opt/networker/bin/sapra_res.jar
  /opt/networker/lib/apps/nmsap/hpux64/libcommonssl.7.6.dev.139.so
  /opt/networker/man/man8/backint.8
  /opt/networker/man/man8/nsrsapadm.8
  /opt/networker/man/man8/nsrsapprobe.8
  /opt/networker/man/man8/nsrsapsv.8
  /opt/networker/man/man8/sapclone.8
  /usr/lib/libnworasap.so
root@MyHPHOST:/hroot#


### Remove a package

root@MyHPHOST:/hroot# swlist -l product | grep NMSAP
  NMSAP                 3.5            EMC NetWorker Module for SAP with Oracle
root@MyHPHOST:/hroot#
root@MyHPHOST:/hroot# swremove NMSAP

=======  08/21/13 14:26:51 METDST  BEGIN swremove SESSION
         (non-interactive) (jobid=MyHPHOST-0432)

       * Session started for user "root@MyHPHOST".

       * Beginning Selection
       * Target connection succeeded for "MyHPHOST:/".
       * Software selections:
             NMSAP.lgto-nmsap,l=/,r=3.5,a=HP-UX_11.XX_64
       * Selection succeeded.


       * Beginning Analysis
       * Session selections have been saved in the file
         "/hroot/.sw/sessions/swremove.last".
       * The analysis phase succeeded for "MyHPHOST:/".
       * Analysis succeeded.


       * Beginning Execution
       * The execution phase succeeded for "MyHPHOST:/".
       * Execution succeeded.


NOTE:    More information may be found in the agent logfile using the
         command "swjob -a log MyHPHOST-0432 @ MyHPHOST:/".

=======  08/21/13 14:27:11 METDST  END swremove SESSION
         (non-interactive) (jobid=MyHPHOST-0432)

root@MyHPHOST:/hroot# swlist -l product | grep NMSAP
root@MyHPHOST:/hroot#



### Install a package



root@MyHPHOST:/hroot# swinstall -s MyHPHOST2:/var/opt/pkgs/depots/Rel.11.31/apps NMSAP

=======  08/21/13 14:30:47 METDST  BEGIN swinstall SESSION
         (non-interactive) (jobid=MyHPHOST-0433)

       * Session started for user "root@MyHPHOST".

       * Beginning Selection
       * Target connection succeeded for "MyHPHOST:/".
       * Source connection succeeded for
         "MyHPHOST2:/var/opt/pkgs/depots/Rel.11.31/apps".
       * Source:
         MyHPHOST2:/var/opt/pkgs/depots/Rel.11.31/apps
       * Targets:                MyHPHOST:/
       * Software selections:
             NMSAP.lgto-nmsap,r=4.0,a=HP-UX_11.XX_64
           + NetWorker.nwr-cbin,r=7.6.3,a=HP-UX_11.XX_64
       * A "+" indicates an automatic selection due to dependency or
         the automatic selection of a patch or reference bundle.
       * Selection succeeded.


       * Beginning Analysis and Execution
       * Session selections have been saved in the file
         "/hroot/.sw/sessions/swinstall.last".
       * "MyHPHOST:/":  1 filesets have a version with a higher
         revision number already installed.
ERROR:   "MyHPHOST:/":  The software dependencies for 1 products or
         filesets cannot be resolved.
       * The analysis phase failed for "MyHPHOST:/".
       * Analysis and Execution had errors.


ERROR:   More information may be found in the agent logfile using the
         command "swjob -a log MyHPHOST-0433 @ MyHPHOST:/".

=======  08/21/13 14:31:03 METDST  END swinstall SESSION
         (non-interactive) (jobid=MyHPHOST-0433)

root@MyHPHOST:/hroot# 

*** Failed becasue of dependencies. To overcomes this, evaluate the dependency condition and exclude it if possible


root@MyHPHOST:/hroot# swinstall -s MyHPHOST2:/var/opt/pkgs/depots/Rel.11.31/apps -x enforce_dependencies=false NMSAP





root@MyHPHOST:/hroot# swlist -l product | grep NMSAP
  NMSAP                 4.0            NetWorker Module for SAP with Oracle
root@MyHPHOST:/hroot#



No comments:

Post a Comment