List subscription repos:
sudo subscription-manager repos --list
List enabled repositories:
sudo dnf repolist sudo dnf repolist --enabled
List disabled repositories:
sudo dnf repolist --disabled
Activate repository:
sudo subscription-manager repos --enable $REPO
List all installed packages:
dnf repoquery --installed
List packages selected by a user (but not automatically to meet dependenciy requirements):
dnf repoquery --userinstalled dnf history userinstalled
List packages in a repository:
dnf repository-packages $REPO list
Search for a package:
dnf search nodejs
List all package version:
dnf search --showduplicates nodejs
List all package versions together with repos:
dnf list --showduplicates nodejs
Check if a package is installed:
dnf list $PKG rpm --verify $PKG rpm -V $PKG
Check a package version:
dnf info $PKG
Check repository/origin availability:
dnf whatprovides $PKG
dnf repoquery -l $PKG rpm -ql $PKG
Using remote metadata:
dnf provides ifconfig dnf repoquery --file /usr/sbin/ifconfig repoquery --whatprovides python3 repoquery --whatprovides libssl*.so.*
Using installed package DB:
rpm -qf /usr/bin/rpm rpm -q --whatprovides /bin/bash
Limit search to a specific repository:
dnf repoquery --disablerepo=* --enablerepo=$REPO -f $PATT
dnf deplist $PKG repoquery --requires --resolve $PKG
If you possess an actual RPM (-q or --query, -R or –requires):
rpm -qpR $RPM
dnf repoquery --alldeps --whatrequires $PKG dnf repoquery --installed --whatrequires $PKG rpm -q --whatrequires $PKG
By package name:
dnf install $PKG
By a package file:
rpm -i $PKG.rpm rpm --install $PKG.rpm
Update a package by a file (same as install but removes all earlier versions):
rpm -U $PKG.rpm rpm --upgrade $PKG.rpm
Streams group related package at specific compatible version. Only one version could be installed in system in time.
For example Node.js has lots of parallel versions:
bash# sudo dnf module list nodejs Name Stream Profiles Summary nodejs 10 [d] common [d], development, minimal, s2i Javascript runtime nodejs 12 common [d], development, minimal, s2i Javascript runtime nodejs 14 common [d], development, minimal, s2i Javascript runtime nodejs 16 common [d], development, minimal, s2i Javascript runtime nodejs 18 common [d], development, minimal, s2i Javascript runtime
You select specific stream:
sudo dnf module install nodejs:18
In order to change stream one need to remove all the packages from original stream and reset the stream:
sudo dnf module remove nodejs sudo dnf module reset nodejs sudo dnf module install nodejs:16
EPEL stands for Extra Packages for Enterprise Linux and you can enable them by installing a special package:
sudo dnf install epel-release sudo dnf install epel-next-release
Cleanup actions from broken previous subscription:
sudo subscription-manager remove --all sudo subscription-manager unregister sudo subscription-manager clean sudo subscription-manager register --username ... sudo subscription-manager refresh sudo subscription-manager attach --auto