How to test a rpm operation for potential conflicts before performing actual operation?
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:
- In the examples above the
--upgradeoperation is used, but other operations such as--installor--erasecan be tested the same way. - The
-vor-vvoptions can be added, to display debugging information. - Refer to How to download rpm packages manually from the Red Hat Customer Portal? to download the packages required for dependencies.
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.