How to test a rpm operation for potential conflicts before performing actual operation?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 7

Issue

How to test a rpm operation for potential conflicts without actually performing the operation?

Resolution

Run the intended command with the --test options, the actual operation will not be performed, potential issues will be reported.

If there is no issue an Exit code of '0' will be returned.

# rpm --upgrade --test package.rpm
..
D: Exit status: 0

An Exit code other than '0' indicates an issue such as Failed dependencies, the debug messages will help troubleshooting the actual failed dependencies issue.

# rpm --upgrade --test package.rpm
..
error: Failed dependencies:
..
D: Exit status: 1

Notes:

SBR
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.