Rob's web

dnf

The Yellowdog Updater, Modified (YUM) is a free and open-source command-line package-management utility for computers running the Linux operating system using the RPM Package Manager. YUM is repalced with dnf.

DNF or Dandified YUM is the next-generation version of the Yellowdog Updater, Modified (yum), a package manager for .rpm-based Linux distributions. DNF was introduced in Fedora 18 in 2013; it has been the default package manager since Fedora 22 in 2015 Red Hat Enterprise Linux 8 and OpenMandriva, and is also an alternative package manager for Mageia.

Perceived deficiencies of yum (which DNF is intended to address) include poor performance, high memory usage, and the slowness of its iterative dependency resolution. DNF uses libsolv, an external dependency resolver.[

DNF performs package management tasks on top of RPM, and supporting libraries.

Configuration

Put your repos in separate files named file.repo in /etc/yum.repos.d.

Help

dnf -h

Options:
  -h, --help            show this help message and exit
  -y, --assumeyes       answer yes for all questions

........

Updating packages

To update installed packages:

# dnf -y update

This must be done at least once a week or before installing new packages.

After kernel update reboot the server. After deamon updates restart service. If not sure reboot server.

Listing installed packages

# dnf repolist
repo id                                       repo name
appstream                                     Rocky Linux 9 - AppStream
baseos                                        Rocky Linux 9 - BaseOS
crb                                           Rocky Linux 9 - CRB
epel                                          Extra Packages for Enterprise Linux 9 - x86_64
epel-cisco-openh264                           Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
extras                                        Rocky Linux 9 - Extras
mariadb-main                                  MariaDB Server
mariadb-maxscale                              MariaDB MaxScale
mariadb-tools                                 MariaDB Tools
plus                                          Rocky Linux 9 - Plus
remi-modular                                  Remi's Modular repository for Enterprise Linux 9 - x86_64
remi-safe                                     Safe Remi's RPM repository for Enterprise Linux 9 - x86_64

Installing packages

To install packages:

dnf install package1 [package2] [...]

The installer checkes for dependecies and installs them also if necesary.

Yum is an alias for dnf.

Removing package without removing dependecies

# dnf --noautoremove erase mariadb

Package info

# dnf info firewalld
Last metadata expiration check: 0:28:17 ago on Tue Oct 29 00:21:36 2024.
Installed Packages
Name         : firewalld
Version      : 1.3.4
Release      : 1.el9
Architecture : noarch
Size         : 2.0 M
Source       : firewalld-1.3.4-1.el9.src.rpm
Repository   : @System
From repo    : minimal
Summary      : A firewall daemon with D-Bus interface providing a dynamic firewall
URL          : http://www.firewalld.org
License      : GPLv2+
Description  : firewalld is a firewall service daemon that provides a dynamic customizable
             : firewall with a D-Bus interface.

DNF history

# dnf history
ID     | Command line                            | Date and time    | Action(s)      | Altered
-----------------------------------------------------------------------------------------------
   166 | -y update                               | 2025-02-28 21:08 | Upgrade        |    1
   165 | -y update                               | 2025-02-26 14:03 | Upgrade        |    4
   164 | -y update                               | 2025-02-24 16:53 | C, E, I, U     |   26 EE
   163 | -y update                               | 2025-02-21 10:22 | Upgrade        |    1
   162 | -y update                               | 2025-02-14 15:45 | C, E, I, U     |   35 EE
   161 | -y update                               | 2025-02-12 09:59 | Upgrade        |    5
   160 | -y update                               | 2025-02-08 15:32 | C, E, I, U     |   20 EE
   159 | -y update                               | 2025-02-05 21:53 | Upgrade        |   34
   158 | install prosody                         | 2025-02-05 21:39 | Install        |    1
   157 | --noautoremove erase prosody            | 2025-02-05 21:37 | Removed        |    1 EE
.....

dnf-automatic

DNF Automatic is an alternative command-line interface to DNF that is suited for automatic and regular execution by using systemd timers, cron jobs, and other such tools.

DNF Automatic synchronizes package metadata as needed, checks for updates available, and then performs one of the following actions depending on how you configure the tool:

The outcome of the operation is then reported by a selected mechanism, such as the standard output or email.

Installing

# dnf install dnf-automatic

Starting

You can use the following timers:

# systemctl start <timer_name>
# systemctl enable <timer_name>

Optional: Check when each of the timers on your system ran the last time:

# systemctl list-timers --all

Links