To generate a list of installed packages
sudo dnf list installed | cat -n
Suppose you want to see all packages that start with x
# dnf list installed "x*"
?
matches any single character.
# dnf list installed "t?r"
To list the available packages for installation
sudo dnf list available | cat -n
dnf -v info <package>
To view all versions of a package in your enabled repositories, use:
dnf --showduplicates list kpartx
To install a specific name-version
dnf update kpartx-0.8.4-22.el8_6.2
dnf upgrade kpartx
dnf -y install kpartx-0.8.4-22.el8_6.2
Get the History of an Installed Package
dnf history list <package_name>
dnf history info <history_id>