DNF : Dandified YUM

redhat

Dandified YUM or simply DNF is an advanced version of the Yellowdog Updater, Modified OR simply YUM, a package manager for rpm-based Linux distributions.

The “yum” commands are still available in Redhat, but they point to DNF.

Listed below are few of the commonly used DNS commands.

List all dnf package names starting with http
[root@centos9test1 ~]# dnf list ‘http*’
====== ==
Last metadata expiration check: 2:44:26 ago on Mon 24 Jun 2024 07:42:17 PM IST.
Available Packages
http-parser.i686
httpcomponents-core.noarch
httpd.x86_64
====== ==

Get additional information about the httpd package
[root@centos9test1 ~]# dnf info httpd
==== ====
Last metadata expiration check: 2:47:46 ago on Mon 24 Jun 2024 07:42:17 PM IST.
Available Packages
Name : httpd
Version : 2.4.57
.
.
Description : The Apache HTTP Server is a powerful, efficient, and extensible web server.
==== ====

List the packages that used the folder /var/www/html

[root@centos9test1 ~]# dnf provides /var/www/html
===== ===
Last metadata expiration check: 2:50:18 ago on Mon 24 Jun 2024 07:42:17 PM IST.
httpd-filesystem-2.4.57-2.el9.noarch : The basic directory layout for the Apache HTTP Server
Repo : appstream
Matched from:
Filename : /var/www/html
===== ===

Command to install httpd
[root@centos9test1 ~]# dnf install httpd

Command to remove httpd
[root@centos9test1 ~]# dnf remove httpd

DNF Groups
===***===

There are collection of realted packages installed together for a purpose. Groups are of two types

  1. Regular Groups: These are collection of packages
  2. Environment Groups: There are collection of groups

Few commands related to groups are:

[root@centos9test1 ~]# dnf group list
[root@centos9test1 ~]# dnf group info “RPM Development Tools”
[root@centos9test1 ~]# dnf group install “RPM Development Tools”

The DNS logs are stored in /var/log/dnf.rpm.log

History of dnf commands used can be found by using the command:

[root@centos9test1 ~]# dnf history

Based on the listing of the commands executed as per the history, we can find additional information about a command executed by using the ID in the history.

[root@centos9test1 ~]# dnf history info 6

You may undo an executed dnf command using the below command

[root@centos9test1 ~]# dnf history undo 6

Additional information about creating a dnf or yum repository can be found here.