dnf/

dnf: list all dependencies of a package

dnf repoquery --deplist <package-name>
| 6 Nov 2023

Do I need to restart after dnf update?

Reboot is needed if one of the following packages was updated:

kernel
glibc
linux-firmware
systemd
dbus

There is an application to easily check it:

sudo dnf install yum-utils
needs-restarting -r
| 22 Apr 2022

List all files installed by a package

List all files installed by a specific package:

sudo dnf repoquery -l golang-bin
| 13 Jul 2021

Print repository usage

Print how many packages are installed per repository:

sudo dnf list --installed | grep -E -o "@.*" | sort | uniq -c
| 29 Mar 2021

List files installed by a package

To list all files installed by dnf package:

rpm -ql dnf
| 29 Jan 2021

fedora: Lockdown a kernel version

Fedora typically keeps 3 latest kernel versions. However, what if you want to keep an old specific kernel version which is known to work well with your system? First, we need to install a dnf plugin that allows us to keep a specific version of any package:

sudo dnf install python3-dnf-plugins-extras-versionlock

Lets find all available kernel versions for your system:

sudo dnf list kernel --showduplicates

Install that specific version of the kernel:

sudo dnf install kernel-5.3.7-301.fc31

And lock it:

sudo dnf versionlock add kernel-5.3.7-301.fc31

To remove the lock:

sudo dnf versionlock delete kernel-5.3.7-301.fc31
| 1 Jan 2020

How to find out which package provides a specific file

If you need to find out, for example, which package in fedora provides htpasswd command, you may do it with the command:

yum provides \*bin/htpasswd
| 1 Jan 2015