Installing in to custom locations with “Installp -R”
Installing software in to custom directories with the “RELOCATABLE” option for the “installp” command to install in a user-specified installation location ( USIL ).
This article will go over the following commands:
installp mkusil rmusil lsusil chusil
Lean how to install software in customized locations.
In this example, I will be showing how to install Java8 in to a custom location ( /web/java ) .
1. Create a user-specified installation location (USIL) instance in the target directory we want to install. 2. Use software that allows relocation. 3. Install relocatable software. 4. Query and maintain relocated software. 5. Cleaning up relocated software and usil instance.
Each USIL instance maintains its own set of Software Vital Product Data (SWVPD), this means you get a small separate Software ODM structure for each specified location. Normally, "installp" will create a USIL instance when you try to install, but in order to do a preview install, you need to manually create one before previewing the install, if we don't have USIL before preview, we will get the following error message:
# installp -R /web/java -acpgXYd . Java8 installp: unable to locate relocated path /web/java in SWVPD
To create USIL instance, we simply run:
# mkusil -R /web/java -X mkusil: Return Status = SUCCESS
You will note that the directory /web/java is now populated with an ODM structure:
Before “mkusil”:
# ls -l /web/java total 0
After “mksuil”:
# ls -lr /web/java/* /web/java/usr: total 0 drwxr-xr-x 4 bin bin 256 Jun 25 09:31 share drwxr-xr-x 2 root system 256 Jun 25 09:32 lpp drwxr-xr-x 3 bin bin 256 Jun 20 13:38 lib /web/java/lpp: total 0 /web/java/etc: total 0 drwxr-xr-x 2 root system 256 Jun 25 08:48 objrepos
We can even use “lsusil” to check the usil instance and see any comments we have added for this instance:
# pwd /web/java # lsusil INSTALL PATH = /web/java COMMENTS = Java8 Install
Now that we have a USIL instance, we can run preview:
# installp -R /web/java -acpgXYd . Java8_64 ******************************************************************************* installp PREVIEW: installation will not actually occur. ******************************************************************************* +-----------------------------------------------------------------------------+ Pre-installation Verification... +-----------------------------------------------------------------------------+ Verifying selections...done Verifying requisites...done Results... SUCCESSES --------- Filesets listed in this section passed pre-installation verification and will be installed. Selected Filesets ----------------- Java8_64.jre (R) 8.0.0.516 # Java SDK 64-bit Java Runtime... << End of Success Section >> +-----------------------------------------------------------------------------+ BUILDDATE Verification ... +-----------------------------------------------------------------------------+ Verifying build dates...done FILESET STATISTICS ------------------ 1 Selected to be installed, of which: 1 Passed pre-installation verification ---- 1 Total to be installed RESOURCES --------- Estimated system resource requirements for filesets being installed: (All sizes are in 512-byte blocks) Filesystem Needed Space Free Space /web 485928 10483160 ----- -------- ------ TOTAL: 485928 10483160 NOTE: "Needed Space" values are calculated from data available prior to installation. These are the estimated resources required for the entire operation. Further resource checks will be made during installation to verify that these initial estimates are sufficient. ****************************************************************************** End of installp PREVIEW. No apply operation has actually occurred. ****************************************************************************
Now that we have a functioning USIL, we can move to the second requisite, which is for the file set to be “RELOCATABLE”.
One way to check if its “RELOCATABLE” is by checking the “.toc” ( Table of contents ) file, at the end of each file set stanza, you will see “RELOCATABLE”, if you don't see it, the file set is not relocatable.
% % RELOCATABLE % %
If you don't have a “.toc” file yet, create one with:
# inutoc .
Another way to check is with the “installp” command it self, you can run:
# installp -qld Java8_64.jre Fileset Name Level I/U Q Content ==================================================================== Java8_64.jre 8.0.0.516 I N usr,root (R) # Java SDK 64-bit Java Runtime Environment
Note the (R) , this means its relocatable, if you don't see it, its not relocatable and the file set cannot be installed in a custom directory.
Next we can move on to actually installing the file set.
The install is done with the installp command. Example syntax:
# installp -R <custom directory> -acgYXd <source dir> <file set>
And here is the actual install log:
# installp -R /web/java -acgYXd ./tmp/java8_base Java8_64 +-----------------------------------------------------------------------------+ Pre-installation Verification... +-----------------------------------------------------------------------------+ Verifying selections...done Verifying requisites...done Results... SUCCESSES --------- Filesets listed in this section passed pre-installation verification and will be installed. Selected Filesets ----------------- Java8_64.jre (R) 8.0.0.517 # Java SDK 64-bit Java Runtime... << End of Success Section >> +-----------------------------------------------------------------------------+ BUILDDATE Verification ... +-----------------------------------------------------------------------------+ Verifying build dates...done FILESET STATISTICS ------------------ 1 Selected to be installed, of which: 1 Passed pre-installation verification ---- 1 Total to be installed +-----------------------------------------------------------------------------+ Installing Software... +-----------------------------------------------------------------------------+ installp: APPLYING software for: Java8_64.jre (R) 8.0.0.517 . . . . . << Copyright notice for Java8_64.jre >> . . . . . . . Licensed Materials - Property of IBM 621000102 Copyright International Business Machines Corp. 1998, 2018. Copyright The Apache Software Foundation, 1999-2007. Copyright Oracle and/or its affiliates, 1992, 2011. All rights reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. . . . . . << End of copyright notice for Java8_64.jre >>. . . . Finished processing all filesets. (Total time: 11 secs). Finished processing all filesets. (Total time: 11 secs). +-----------------------------------------------------------------------------+ Summaries: +-----------------------------------------------------------------------------+ Installation Summary -------------------- Name Level Part Event Result ------------------------------------------------------------------------------- Java8_64.jre (R) 8.0.0.517 USR APPLY SUCCESS Java8_64.jre (R) 8.0.0.517 ROOT APPLY SUCCESS
flags info:
-a apply software -c commit software -g Automatically install dependent software ( if any ) -X Automatically expand used file systems ( if needed ) -Y Accept software license agreements. -d Directory containing the install medium.
The file set binaries or in this case Java8 and the install files will be located in the custom directory or in our case /web/java directory:
/web/java/usr/java8_64/jre/bin/java /web/java/usr/java8_64/jre/bin/javaw /web/java/usr/java8_64/jre/bin/javaws /web/java/usr/java8_64/jre/bin/jcontrol /web/java/usr/java8_64/jre/bin/jdmpview /web/java/usr/java8_64/jre/bin/jextrac
Now that we have installed software in a separate directory, we should be using normal commands like “lslpp” and “lppchk” with the -R flag to query software in the relocated directory:
# lslpp -R /web/java -l Fileset Level State Description ---------------------------------------------------------------------------- Path: /web/java/usr/lib/objrepos Java8_64.jre 8.0.0.517 COMMITTED Java SDK 64-bit Java Runtime Environment Path: /web/java/etc/objrepos Java8_64.jre 8.0.0.517 COMMITTED Java SDK 64-bit Java Runtime Environment
If we try to run those without -R , the output will NOT show the relocated software:
# lslpp -l | grep -i java8
The lppchk command is executed with the same -R flag to effect the relocated software.
# lppchk -R /web/java -v
If we need to update the reallocated software, we must use the “installp” command. Commands like “smitty update_all” and “install_all_updates” cannot be used for reallocated software.
# installp -R /web/java -agYXd ./java_update all +-----------------------------------------------------------------------------+ Pre-installation Verification... +-----------------------------------------------------------------------------+ Verifying selections...done Verifying requisites...done Results... SUCCESSES --------- Filesets listed in this section passed pre-installation verification and will be installed. Selected Filesets ----------------- Java8_64.jre (R) 8.0.0.521 # Java SDK 64-bit Java Runtime... << End of Success Section >> +-----------------------------------------------------------------------------+ BUILDDATE Verification ... +-----------------------------------------------------------------------------+ Verifying build dates...done FILESET STATISTICS ------------------ 1 Selected to be installed, of which: 1 Passed pre-installation verification ---- 1 Total to be installed +-----------------------------------------------------------------------------+ Installing Software... +-----------------------------------------------------------------------------+ installp: APPLYING software for: Java8_64.jre (R) 8.0.0.521 . . . . . << Copyright notice for Java8_64.jre >> . . . . . . . Licensed Materials - Property of IBM 621000102 Copyright International Business Machines Corp. 1998, 2018. Copyright The Apache Software Foundation, 1999-2007. Copyright Oracle and/or its affiliates, 1992, 2011. All rights reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. . . . . . << End of copyright notice for Java8_64.jre >>. . . . Finished processing all filesets. (Total time: 11 secs). Finished processing all filesets. (Total time: 11 secs). +-----------------------------------------------------------------------------+ Summaries: +-----------------------------------------------------------------------------+ Installation Summary -------------------- Name Level Part Event Result ------------------------------------------------------------------------------- Java8_64.jre (R) 8.0.0.521 USR APPLY SUCCESS Java8_64.jre (R) 8.0.0.521 ROOT APPLY SUCCESS
Removing the usil instance is easy and done with # rmusil command.
# rmusil -R /web/java -r rm: removing /web/java/etc/objrepos/history rm: removing /web/java/etc/objrepos/history.vc rm: removing /web/java/etc/objrepos/inventory rm: removing /web/java/etc/objrepos/inventory.vc rm: removing /web/java/etc/objrepos/lpp rm: removing /web/java/etc/objrepos/lpp.vc rm: removing /web/java/etc/objrepos/product rm: removing /web/java/etc/objrepos/product.vc rm: removing /web/java/usr/lib/objrepos/history rm: removing /web/java/usr/lib/objrepos/history.vc rm: removing /web/java/usr/lib/objrepos/inventory rm: removing /web/java/usr/lib/objrepos/inventory.vc rm: removing /web/java/usr/lib/objrepos/lpp rm: removing /web/java/usr/lib/objrepos/lpp.vc rm: removing /web/java/usr/lib/objrepos/product rm: removing /web/java/usr/lib/objrepos/product.vc rm: removing /web/java/usr/lib/objrepos/fix rm: removing /web/java/usr/lib/objrepos/fix.vc rm: removing /web/java/usr/lib/objrepos/lag rm: removing /web/java/usr/lib/objrepos/lag.vc rm: removing /web/java/usr/lib/objrepos/vendor rm: removing /web/java/usr/lib/objrepos/vendor.vc rm: removing /web/java/usr/share/lib/objrepos/history rm: removing /web/java/usr/share/lib/objrepos/history.vc rm: removing /web/java/usr/share/lib/objrepos/inventory rm: removing /web/java/usr/share/lib/objrepos/inventory.vc rm: removing /web/java/usr/share/lib/objrepos/lpp rm: removing /web/java/usr/share/lib/objrepos/lpp.vc rm: removing /web/java/usr/share/lib/objrepos/product rm: removing /web/java/usr/share/lib/objrepos/product.vc
Where “-r” will remove the actual ODM files, if not used, the ODM files will remain, but the USIL instance will not be operational.
*** NOTE that the USIL instance should be removed only after the RELOCATABLE software was uninstalled. The “rmusil” command will remove the ODM without warning even if there is installed software, at this point the software will not be recoverable.
Removing the installed software is done again with the installp command and the use of the -R flag :
# installp -R /web/java -ug Java8_64.jre +-----------------------------------------------------------------------------+ Pre-deinstall Verification... +-----------------------------------------------------------------------------+ Verifying selections...Info : /usr/java8_64/jre/lib/security did not exist prior to install, therefore no backup occurred Info : /usr/java8_64/jre/lib/ext did not exist prior to install, therefore no backup occurred done Verifying requisites...done Results... SUCCESSES --------- Filesets listed in this section passed pre-deinstall verification and will be removed. Selected Filesets ----------------- Java8_64.jre (R) 8.0.0.526 # Java SDK 64-bit Java Runtime... << End of Success Section >> FILESET STATISTICS ------------------ 1 Selected to be deinstalled, of which: 1 Passed pre-deinstall verification ---- 1 Total to be deinstalled +-----------------------------------------------------------------------------+ Deinstalling Software... +-----------------------------------------------------------------------------+ installp: DEINSTALLING software for: Java8_64.jre (R) 8.0.0.526 Finished processing all filesets. (Total time: 4 secs). +-----------------------------------------------------------------------------+ Summaries: +-----------------------------------------------------------------------------+ Installation Summary -------------------- Name Level Part Event Result ------------------------------------------------------------------------------- Java8_64.jre (R) 8.0.0.526 ROOT DEINSTALL SUCCESS Java8_64.jre (R) 8.0.0.526 USR DEINSTALL SUCCESS
flag info:
-u uninstall software. -g remove dependent software automatically ( if any )
Additional info:
With the "chsuil" command, one can change the comment of the USIL instance, but that's pretty much all to "chusil"
# lsusil -R /web/java INSTALL PATH = /web/java COMMENTS = Java8 Install # chusil -R /web/java -c "New Java8 Install" chusil: Return Status = SUCCESS # lsusil -R /web/java INSTALL PATH = /web/java COMMENTS = New Java8 Install
And that's pretty much all that “chusil does”
The newly installed software location will NOT be added to the “$PATH” variable automatically, so to use it you must use the full path or add it the “$PATH” variable.
You can have multiple usil instances with the same software installed.