[ About | Licence | Contacts ]
Written by Oleksandr Gavenko (AKA gavenkoa), compiled on 2023-03-19 from rev 7705e3c293ae.

dnf package manager

List packages

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

Check package details

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

List package's files

dnf repoquery -l $PKG
rpm -ql $PKG

Find packages a file belong to

Using remote metadata:

dnf provides ifconfig
dnf repoquery --file /usr/sbin/ifconfig

Using installed package DB:

rpm -qf /usr/bin/rpm

List package dependencies

repoquery --requires --resolve $PKG

If you possess a actual RPM:

rpm -qpR $RPM

List of packages that depend on a given

dnf repoquery --alldeps --whatrequires $PKG
dnf repoquery --installed --whatrequires $PKG
rpm -q --whatrequires $PKG

Dealing with streams

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