What are the advantages of using yum/dnf over rpm?

Solution Verified - Updated

Environment

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

Issue

  • What are the advantages of using yum/dnf over rpm?
  • Is there a difference between using rpm and yum/dnf to install an RPM package?
  • Should I use yum/dnf instead of rpm when installing RPM packages?

Resolution

  • It is generally recommended to use yum/dnf to install RPM packages instead of the rpm command.
  • When using yum/dnf, the installation is tracked in the package transaction history, allowing administrators to:
    • Review installed, updated, or removed packages.
    • Undo or roll back specific transactions if needed.
    • Automatically resolve and install package dependencies when repositories are available.
  • In contrast, the rpm command performs low-level operations and does not handle dependency resolution or transaction logging.
  • For further details related to package transaction history provided by yum/dnf, refer to the following documents:

Root Cause

  • The rpm command lacks the capability to manage dependencies or maintain transaction history.
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.