Installing RPM on RHEL 8

Hi ,I have to install one rpm on my endpoints, i have added the prefetch command in my action script now i have to install this rpm, i have tried using __createfile and then move this to sh script and finally running this script as below.
wait chmod 755 install.sh
wait /bin/sh -c install.sh
But with this i am not able to install the rpm, what is the prefered way of doing it? can i directly run the rpm from wait like “wait rpm -ivh package.rpm” will this also work?

I’ve used both the direct call to RPM and via a .sh script to invoke the rpm. Using the direct call to rpm you should also include the __Download in the path to the rpm unless you are copying the file to a specific location

wait rpm -ivh __Download/package.rpm

Here is how I am handling downloading and installing RPMs. Its been a while, but I was having issues with doing the chmod in the __Download directory.

// Prefetch the Nessus agent from the designated URL prefetch NessusAgent-8.2.3-es7.x86_64.rpm sha1:15275f6a6f31d96bf7d32865f09ec7691d3192a5 size:16369712 https://repo.local.com/NessusAgent-8.2.3-es7.x86_64.rpm

// Good housekeeping delete “/tmp/NessusAgent-8.2.3-es7.x86_64.rpm”

// Move the downloaded RPM to TMP directory move “__Download/NessusAgent-8.2.3-es7.x86_64.rpm” “/tmp/NessusAgent-8.2.3-es7.x86_64.rpm”

// Update RPM permissions wait sudo su - root -c “chmod 744 /tmp/NessusAgent-8.2.3-es7.x86_64.rpm” parameter “__ExitCode01” = “{if exist exit code of action then exit code of action as string else “999”}” if {parameter “__ExitCode01” != “0”} exit {parameter “__ExitCode01”} endif

// Execute RPM install command for Nessus agent wait sudo su - root -c “yum install -y /tmp/NessusAgent-8.2.3-es7.x86_64.rpm” parameter “__ExitCode02” = “{if exist exit code of action then exit code of action as string else “998”}” if {parameter “__ExitCode02” != “0”} exit {parameter “__ExitCode02”} endif

1 Like

Hi Rich,
Thanks, i think i am still missing somthing, the checks that you have applied for exit code is showing the error

And also the wait command it is showing error as root is not in the sudoers group
wait sudo su - root -c “chmod 744 /tmp/NessusAgent-8.2.3-es7.x86_64.rpm”

Also not sure why you need to chmod. The issue generally for altering permissions like that is many systems have restrictions that prevent the +X bit being turned on in /var

You don’t need this installed though, and as you have an RPM why use yum to install it and not rpm?
There can be interesting side effects and using “wait rpm <parameters>” does trigger special behaviour in the client so I’d suggest using that instead/