How to verify if a package is installed?

Solution Verified - Updated

Environment

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

Issue

  • How to verify if a package is installed ?
  • How to check which version of a package is installed ?
  • How to determine if a specific package exists on my system?
  • What command shows installed package versions in RHEL?

Resolution

  • Using dnf package manager on RHEL 8/9/10 (the yum alias also works).
# dnf list installed <package_name>
  • Using yum package manager on RHEL 6/7.
# yum list installed <package_name>
  • Using rpm command.
# rpm -q <package_name>
  • Notes:
    • In RHEL 8, 9, and 10, some packages are distributed through AppStream modules. For module-specific verification, see: How to verify if an AppStream module is installed?
    • If both 64-bit and 32-bit versions of a package are installed, both versions will be returned.
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.