Install RPM from NIM LPP without smitty

I want to install single RPM from LPP on NIM system without doing it interactively (with single non-interactive command), so I 'got' that command from smitty this way:

# smitty nim > Install and Update Software > Install Software

Select the LPP_SOURCE containing the install images

> RPMS_AIX53          resources       lpp_source

Software to Install [F4]

  sudo
    @@R:sudo-1.6.9p23-2 1.6.9p23-2
>   @@R:sudo-1.6.9p23-2noldap 1.6.9p23-2noldap
* LPP_SOURCE             RPMS_AIX53
* Software to Install   [@@R:sudo-1.6.9p23-2noldap 1.6.9p23-2noldap]  

After pressing F6 now I get the command.

+--------------------------------------------------------------------------+
|                           SHOW COMMAND STRING                            |
|                                                                          |
| Press Enter or Cancel to return to the                                   |
| application.                                                             |
|                                                                          |
|   /usr/lpp/bos.sysmgt/nim/methods/c_sm_nim cust  -l 'RPMS_AIX53' -o '@@R |
|   :sudo-1.6.9p23-2noldap 1.6.9p23-2noldap' -f '' -f '' -f '' -f 'c' -f ' |
|   N' -f 'g' -f 'X' -f '' -f ''                                           |
|                                                                          |
| F1=Help                 F2=Refresh              F3=Cancel                |
| F8=Image                F10=Exit                Enter=Do                 |
+--------------------------------------------------------------------------+

... but when I type this command in terminal, I get this error:

# /usr/lpp/bos.sysmgt/nim/methods/c_sm_nim cust  -l 'RPMS_AIX53' -o '@@R:sudo-1.6.9p23-2noldap 1.6.9p23-2noldap' -f '' -f '' -f 'Y' -f 'c' -f 'N' -f 'g' -f 'X' -f '' -f ''
0042-001 nimclient: processing error encountered on "c003s1154":
   0042-175 c_showres: An unexpected result was returned by the "/usr/lib/instl/sm_inst" command:

0042-231 c_sm_nim:  Unable to generate the formatted list of software
to install.

What am I doing wrong?

This command is not supposed to be used outside SMIT. Use a simple "nim" command, which is done in two steps: first allocate the resource on the nim server, then use it on the client:

nim -o allocate -a lpp_source=<lpp_source> <client>
nim -o cust -a lpp_source=<lpp_source> -a filesets=<fileset> <client>

I hope this helps.

bakunin

1 Like

@bakunin

Thanks for suggestion.

I need that instruction to propagate that RPM on 100+ LPARS, is there a better way then propagating that LPP for each LPAR separately?

hmmm... isn't that already a good way to do it? After all, you could use a script like (just a barebone sketch - add error checking to your hearts content):

#! /bin/ksh
typeset chLppSrc="<lpp_source>"
typeset chFilSet="<fileset>"
typeset chHost=""

while read chHost ; do
     nim -o allocate -a lpp_source="$chLppSrc" "$chHost"
     nim -o cust -a lpp_source="$chLppSrc" -a filesets="$chFilSet" "$chHost"
done < /path/to/hosts.list

I hope this helps.

bakunin

1 Like

You can always create a group of LPARs in NIM and deploy the proms that way.

1 Like

@ross.mather
Thanks, I will try that method also.

My buddy also found that install method from client:

CLIENT # nimclient -o cust -a lpp_source=RPMS_AIX53 -a  filesets=sudo-1.6.9p23-2noldap.aix5.3.ppc.rpm -a accept_licenses=yes -a  show_progress=yes

As for @bakunin method ... it also work, displays errors, but works, here are the results:

Before.

CLIENT # rpm -qa
AIX-rpm-7.1.1.15-1
tcl-8.4.7-3
tk-8.4.7-3
expect-5.42.1-3
bash-3.2-1

After.

CLIENT # rpm -qa
sudo-1.6.9p23-2noldap
tcl-8.4.7-3
tk-8.4.7-3
expect-5.42.1-3
bash-3.2-1
AIX-rpm-7.1.2.0-2

Commands from NIM.

NIM # nim -F -o allocate -a lpp_source="RPMS_AIX53" "CLIENT"
NIM # nim -F -o deallocate -a lpp_source="nim_script" "CLIENT"
NIM # nim -o cust -a lpp_source="RPMS_AIX53" -a filesets="sudo-1.6.9p23-2noldap 1.6.9p23-2noldap" "CLIENT"

Validating RPM package selections ...

Please wait...
sudo                        ##################################################

+-----------------------------------------------------------------------------+
                          RPM  Error Summary:
+-----------------------------------------------------------------------------+
The following packages were requested for installation 
but were not found on the media:
1.6.9p23-2noldap

0042-001 nim: processing error encountered on "master":
   0042-001 m_cust: processing error encountered on "CLIENT":
   0042-175 c_script: An unexpected result was returned by the "NIM:/export/nim/scripts/CLIENT.script" command:

0042-175 c_installp: An unexpected result was returned by the "/usr/sbin/installp" command:
See the log file:
        /var/adm/ras/nim.installp
for details or use the "showlog" operation.



NIM # cat /export/nim/scripts/CLIENT.script

#!/bin/ksh
CLIENT.script: END
# nim_script for CLIENT
result=success

export NIM_NON_41_MASTER=yes
export NIM_SHOW_PROGRESS=yes
export NIM_SCRIPT=yes
# lpp_source=RPMS_AIX53
/usr/lpp/bos.sysmgt/nim/methods/c_installp ${VERBOSE} \
        -afilesets="sudo-1.6.9p23-2noldap 1.6.9p23-2noldap" \
        -alpp_source=NIM:/export/PACKAGES/RPMS_AIX53
[[ $? != 0 ]] && result=failure

[[ ${result} = success ]] && exit 0 || exit 1

In other words, problem solved, thank You for help gentleman.