RPM install returns status 0 after the post-install script fails with a non-zero status.

Article: 100056022
Last Published: 2025-09-18
Ratings: 0 1
Product(s): NetBackup

Problem

When performing a silent installation on a Linux system, the rpm installation returns a 0 status even when the post-install phase fails.

 

Error Message

Example:

# rpm -U VRTSnbpck.rpm

nbcertcmdtool: The -ping operation failed.
EXIT STATUS 26: client/server handshaking failed

ERROR:   Cannot set up secure communication.
         The attempt to contact the primary server failed.

Previously reported errors prevent NetBackup from being fully configured.
Fix the issue and re-install the VRTSnbpck package. 
You may need to use the package manager's force option.

Wed May 31 13:40:48 CDT 2023: Install of package VRTSnbpck, post-install phase, failed.
warning: %post(VRTSnbpck-10.2.1.0-1685538232.x86_64) scriptlet failed, exit status 1

# echo $?

0

For NetBackup install, when a post-install scriptlet fails, the temporary file /tmp/previous_rpm_pkg_install_failed is created. The content specifies the failed package name and the log file path.

The presence of this file prevents the next rpm from being installed, as shown in the example below.

#  cat /tmp/previous_rpm_pkg_install_failed
VRTSnbpck
/tmp/install_VRTSnbpck_trace.21515

# rpm -U VRTSpbx.rpm 
ERROR:   The VRTSnbpck package did not install successfully.
         Please look at the /tmp/install_VRTSnbpck_trace.21515
         install trace for more details.

error: %pre(VRTSpbx-1.18.1.0-0.x86_64) scriptlet failed, exit status 1
error: VRTSpbx-1.18.1.0-0.x86_64: install failed

 

Cause

The rpm package manager on Linux has a directive that if a post-install scriptlet fails, rpm still indicates the package is successfully installed.

  • The next NetBackup rpm install will check for /tmp/previous_rpm_pkg_install_failed if the post-install scriptlet of the previous rpm failed.
  • So if the failed package is the last package to be installed, there is no subsequent package to catch the failure.

 

Solution

To resolve the issue, users can simply check for the existence and content of:

  •  /tmp/previous_rpm_pkg_install_failed.

1. Fix the error indicated in the script output and in the log file specified by  /tmp/previous_rpm_pkg_install_failed.
2. Remove and then reinstall the rpm.

 

References:

569930 – rpm exits 0 on scriptles failure (redhat.com)
1730266 – Rpm post scriplet failed with exit status 1 but return status of rpm is 0 (redhat.com)
Bug #675954 “rpm exits 0 on scriptles failure” : Bugs : RPM (launchpad.net)

Was this content helpful?