How to verify if an AppStream module is installed?
Environment
- Red Hat Enterprise Linux 8, 9
Issue
- How to verify if an AppStream module is installed ?
- How to check which Stream of an AppStream module is installed ?
Note:
This knowledge article is specific to application distributed as Appstream modules starting with RHEL 8.
Refer to the following links for a list of applications distributed as modules:
To verify if a package distributed as a RPM package is installed refer to the following knowledge article:
Resolution
Use the yum or dnf command with the module list sub-command and the --installed option to only list modules that are installed.
Example:
# yum module list --installed container-tools
Name Stream Profiles Summary
container-tools rhel8 ...
#
Note: The above output has been truncated for clarity.
Given the above output one can confirm that the rhel8 stream of the container-toolsmodule is installed,
meaning all the packages part of the given module are installed.
If the container-tools module is not installed, the yum command will explicitely say so, as in the example below:
# yum module list --installed container-tools
Error: No matching Modules to list
To see which stream is enabled, use the command below, in this example the rhel8 stream is enabled:
# yum module list --enabled container-tools
Name Stream
container-tools rhel8 [d][e]
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
Note: The above output has been truncated for clarity.
Also a module shows as installed only if all the packages that are part of it are installed.
To get a list of all the installed packages from a given AppStream module, use the following command:
# yum module repoquery --installed container-tools
criu-3.18-4.module+el8.9.0+21243+a586538b.x86_64
#
In the following example, the only package from the container-tools module that is installed is the criu package.
Moreover to query specific packages and print the AppStream module and stream they are part of,
use the following command:
# rpm --qf '%{NAME} %{MODULARITYLABEL}\n' -q podman buildah
podman container-tools:rhel8:8090020240201111839:d7b6f4b7
buildah container-tools:rhel8:8090020240201111839:d7b6f4b7
In the above example both buildah and podman packages from the container-tools AppStream module rhel8 stream are installed, 8090020240201111839 is the module version and d7b6f4b7 the module context.
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.