This is an old revision of the document!


RHEL 10 dnf command

  • plugins
$ tree -F /etc/dnf
/etc/dnf/
├── aliases.d/
├── dnf.conf
├── modules.d/
├── modules.defaults.d/
├── plugins/
│   ├── copr.conf
│   ├── copr.d/
│   └── debuginfo-install.conf
├── protected.d/
│   ├── almalinux-release.conf
│   ├── grub2-pc.conf
│   ├── grub2-tools-minimal.conf
│   ├── selinux-policy-targeted.conf
│   ├── setup.conf
│   ├── sudo.conf
│   ├── systemd.conf
│   └── yum.conf
├── usr-drift-protected-paths.d/
└── vars/
    └── stream

Here's /etc/dnf/dnf.conf:

[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False

For help:

$ man dnf.conf
  • dnf repolist
  • dns repoinfo
  • dnf repoquery
  • dnf repository-packages
  • dnf search
  • dnf info
  • dnf list
  • dnf install, dnf remove
  • dnf provides
  • dnf config-manager
  • dnf group

For help on any of them:

$ dnf help group

List current repositories with dnf repolist:

$ dnf repolist
repo id                              repo name
appstream                            AlmaLinux 10 - AppStream
baseos                               AlmaLinux 10 - BaseOS
crb                                  AlmaLinux 10 - CRB
extras                               AlmaLinux 10 - Extras
*

More information with dnf repoinfo:

$ dnf repoinfo
... snip ...
$

Info about a specific repository:

$ dnf repoinfo crb
Repo-id            : crb
Repo-name          : AlmaLinux 10 - CRB
Repo-status        : enabled
Repo-revision      : 1792407590
Repo-updated       : Mon 19 Oct 2026 06:59:50 AM
Repo-pkgs          : 1,807
Repo-available-pkgs: 1,807
Repo-size          : 25 G
Repo-mirrors       : https://mirrors.almalinux.org/mirrorlist/10/crb
Repo-baseurl       : https://almalinux.mirror.globo.tech/10.2/CRB/x86_64/os/ (9 more)
Repo-expire        : 86,400 second(s) (last: Tue 20 Oct 2026 04:00:14 AM)
Repo-filename      : /etc/yum.repos.d/almalinux-crb.repo
Total packages: 1,807
$

Scan all repositories:

$ dnf repoquery | wc -l
12088
$

List packages in a given repo:

$ dnf repository-packages extras list
Last metadata expiration check: 6:33:25 ago on Thu 22 Oct 2026 10:24:38 AM.
Available Packages
alma-certify.noarch                                  1.0.0-1.el10                         extras
almalinux-release-devel.x86_64                       10-1.el10                            extras
almalinux-release-nvidia-driver.x86_64               10-5.el10_1                          extras
almalinux-release-opennebula-addons.x86_64           10-1.el10                            extras
almalinux-release-synergy.x86_64                     10-1.el10                            extras
almalinux-release-testing.x86_64                     10-2.el10                            extras
anaconda-live.noarch                                 40.22.3.46-1.el10_2.alma.1           extras
centos-release-ceph-squid.noarch                     1.0-2.el10                           extras
centos-release-cloud.noarch                          1-1.el10                             extras
centos-release-messaging.noarch                      1-5.el10                             extras
centos-release-nfs-ganesha7.noarch                   1.0-1.el10                           extras
centos-release-nfv-common.noarch                     1-5.el10                             extras
centos-release-nfv-openvswitch.noarch                1-5.el10                             extras
centos-release-ovirt45.noarch                        10.0-4.el10_1                        extras
centos-release-ovirt45-testing.noarch                10.0-4.el10_1                        extras
centos-release-rabbitmq-4.noarch                     1-5.el10                             extras
centos-release-samba421.noarch                       1.0-1.el10                           extras
centos-release-samba422.noarch                       1.0-1.el10                           extras
centos-release-samba423.noarch                       1.0-1.el10                           extras
centos-release-samba424.noarch                       1.0-1.el10                           extras
centos-release-storage-common.noarch                 2-2.el10                             extras
centos-release-virt-common.noarch                    1-1.el10                             extras
epel-release.noarch                                  10-6.el10                            extras
livesys-scripts.noarch                               0.6.4-1.el10                         extras
xisxwayland.x86_64                                   2-4.el10                             extras
$

dnf list:

$ dnf list --all                     [default]
$ dnf list --installed
$ dnf list --available

Other useful variations:

$ dnf list --updates
$ dnf list --recent

Yeesh:

$ dnf help search
usage: dnf search [-c [config file]] [-q] [-v] [--version] [--installroot [path]]
                  [--nodocs] [--noplugins] [--enableplugin [plugin]]
                  [--disableplugin [plugin]] [--releasever RELEASEVER]
                  [--releasever-major RELEASEVER_MAJOR]
                  [--releasever-minor RELEASEVER_MINOR] [--setopt SETOPTS]
                  [--skip-broken] [-h] [--allowerasing] [-b | --nobest] [-C]
                  [-R [minutes]] [-d [debug level]] [--debugsolver] [--showduplicates]
                  [-e ERRORLEVEL] [--obsoletes] [--rpmverbosity [debug level name]]
                  [-y] [--assumeno] [--enablerepo [repo]] [--disablerepo [repo] |
                  --repo [repo]] [--enable | --disable] [-x [package]]
                  [--disableexcludes [repo]] [--repofrompath [repo,path]]
                  [--noautoremove] [--nogpgcheck] [--color COLOR] [--refresh] [-4]
                  [-6] [--destdir DESTDIR] [--downloadonly] [--transient]
                  [--comment COMMENT] [--bugfix] [--enhancement] [--newpackage]
                  [--security] [--advisory ADVISORY] [--bz BUGZILLA] [--cve CVES]
                  [--sec-severity {Critical,Important,Moderate,Low}]
                  [--forcearch ARCH] [--all]
                  KEYWORD [KEYWORD ...]

... snip ...

Simple searching:

$ dnf search trace
Last metadata expiration check: 0:24:18 ago on Tue 20 Oct 2026 04:00:14 AM.
============================ Name & Summary Matched: trace =============================
boost-stacktrace.x86_64 : Run-time component of boost stacktrace library
crash-trace-command.x86_64 : Trace extension module for the crash utility
libbabeltrace.x86_64 : Common Trace Format Babel Tower
libbabeltrace-devel.x86_64 : Common Trace Format Babel Tower
libtracecmd.x86_64 : A library for reading tracing instances stored in a trace file
libtracecmd-devel.x86_64 : Development files for libtracecmd
libtraceevent.x86_64 : Library to parse raw trace event formats
libtraceevent-devel.x86_64 : Development headers of libtraceevent
libtracefs.x86_64 : Library for access kernel tracefs
libtracefs-devel.x86_64 : Development headers of libtracefs
libvdpau-trace.x86_64 : Trace library for libvdpau
pcp-pmda-bpftrace.x86_64 : Performance Co-Pilot (PCP) metrics from bpftrace scripts
perl-Devel-StackTrace.noarch : Perl module implementing stack trace and stack trace
                             : frame objects
potrace-devel.x86_64 : Potrace development library and headers
python3-babeltrace.x86_64 : Common Trace Format Babel Tower
systemtap-sdt-dtrace.x86_64 : Static probe support dtrace tool
trace-cmd.x86_64 : A user interface to Ftrace
traceroute.x86_64 : Traces the route taken by packets over an IPv4/IPv6 network
================================= Name Matched: trace ==================================
blktrace.x86_64 : Utilities for performing block layer IO tracing in the Linux kernel
bpftrace.x86_64 : High-level tracing language for Linux eBPF
ltrace.x86_64 : Tracks runtime library calls from dynamically linked executables
pcp-pmda-trace.x86_64 : Performance Co-Pilot (PCP) metrics for application tracing
potrace.x86_64 : Transform bitmaps into vector graphics
strace.x86_64 : Tracks and displays system calls associated with a running process
================================ Summary Matched: trace ================================
kernelshark.x86_64 : GUI analysis for Ftrace data captured by trace-cmd
libipt.x86_64 : Intel Processor Trace Decoder Library
lttng-ust.x86_64 : LTTng Userspace Tracer library
lttng-ust-devel.x86_64 : LTTng Userspace Tracer library headers and development files
memstrack.x86_64 : A memory allocation tracer, like a hot spot analyzer for memory
                 : allocation
mtr.x86_64 : Network diagnostic tool combining 'traceroute' and 'ping'
php-pecl-xdebug3.x86_64 : Provides functions for function traces and profiling
php8.4-pecl-xdebug3.x86_64 : Provides functions for function traces and profiling
$ dnf repoquery strace
Last metadata expiration check: 5:56:08 ago on Tue 20 Oct 2026 04:00:14 AM.
strace-0:6.12-3.el10.x86_64
$
$ dnf info strace
Last metadata expiration check: 0:26:05 ago on Tue 20 Oct 2026 04:00:14 AM.
Available Packages
Name         : strace
Version      : 6.12
Release      : 3.el10
Architecture : x86_64
Size         : 1.4 M
Source       : strace-6.12-3.el10.src.rpm
Repository   : baseos
Summary      : Tracks and displays system calls associated with a running process
URL          : https://strace.io
License      : LGPL-2.1-or-later AND GPL-2.0-or-later AND GPL-3.0-or-later AND
             : BSD-2-Clause AND BSD-3-Clause AND (GPL-1.0-or-later WITH
             : Linux-syscall-note) AND (GPL-2.0-or-later WITH Linux-syscall-note) AND
             : (GPL-2.0-only WITH Linux-syscall-note) AND (LGPL-2.0-or-later WITH
             : Linux-syscall-note) AND (LGPL-2.1-or-later WITH Linux-syscall-note) AND
             : ((GPL-2.0-only WITH Linux-syscall-note) OR Linux-OpenIB) AND
             : ((GPL-2.0-only WITH Linux-syscall-note) OR MIT) AND ((GPL-2.0-or-later
             : WITH Linux-syscall-note) OR BSD-3-Clause) AND ISC AND X11 AND FSFAP AND
             : FSFUL AND FSFULLR AND FSFULLRWD
Description  : The strace program intercepts and records the system calls called and
             : received by a running process.  Strace can print a record of each
             : system call, its arguments and its return value.  Strace is useful for
             : diagnosing problems and debugging, as well as for instructional
             : purposes.
             : 
             : Install strace if you need a tool to track the system calls made and
             : received by a process.
$
$ dnf provides /usr/bin/strace
AlmaLinux 10 - AppStream                                                23 MB/s |  25 MB     00:01    
AlmaLinux 10 - BaseOS                                                   33 MB/s |  51 MB     00:01    
AlmaLinux 10 - CRB                                                     7.8 MB/s | 5.3 MB     00:00    
AlmaLinux 10 - Extras                                                   85 kB/s |  25 kB     00:00    
strace-6.12-3.el10.x86_64 : Tracks and displays system calls associated with a running process
Repo        : baseos
Matched from:
Filename    : /usr/bin/strace
$ sudo dnf install strace
$ rpm -q strace
$ sudo dnf remove strace
$ dnf repoquery
$ dnf repoquery --installed
$ dnf repoquery --available
$ dnf repoquery --upgrades
$ dnf config-manager --dump
$ dnf config-manager --dump-variables

List enabled repositories:

$ dnf repolist [--enabled]
repo id                                     repo name
appstream                                   AlmaLinux 10 - AppStream
baseos                                      AlmaLinux 10 - BaseOS
crb                                         AlmaLinux 10 - CRB
extras                                      AlmaLinux 10 - Extras
$

What about the disabled repos?

$ dnf repolist --disabled
repo id                                      repo name
appstream-debuginfo                          AlmaLinux 10 - AppStream - Debug
appstream-source                             AlmaLinux 10 - AppStream - Source
baseos-debuginfo                             AlmaLinux 10 - BaseOS - Debug
baseos-source                                AlmaLinux 10 - BaseOS - Source
crb-debuginfo                                AlmaLinux 10 - CRB - Debug
crb-source                                   AlmaLinux 10 - CRB - Source
extras-debuginfo                             AlmaLinux 10 - Extras - Debug
... snip ...
$

Disable, verify, re-enable:

$ sudo dnf config-manager --disable crb
$ dnf repolist
$ sudo dnf config-manager --enable crb

Last part of dnf help group:

Group command-specific options:
  --with-optional       include optional packages from group
  --hidden              show also hidden groups
  --installed           show only installed groups
  --available           show only available groups
  --ids                 show also ID of groups

  COMMAND               available subcommands: summary (default), list, info, remove, install,
                        upgrade, mark
  COMMAND_ARG           argument for group subcommand

List both installed and available groups:

$ dnf group list
AlmaLinux 10 - CRB                                                      13 kB/s | 3.8 kB     00:00    
Available Environment Groups:
   Server with GUI
   Server
   Workstation
   Virtualization Host
   Custom Operating System
Installed Environment Groups:
   Minimal Install
Available Groups:
   Console Internet Tools
   Container Management
   .NET Development
   RPM Development Tools
... snip ...

You can guess the rest. As an example:

$ sudo dnf group install "Virtualization Host"

... snip ...

Installing Environment Groups:
 Virtualization Host                                                                           
Installing Groups:
 Base                                                                                          
 Core                                                                                          
 Standard                                                                                      
 Virtualization Hypervisor                                                                     
 Virtualization Tools                                                                          

Transaction Summary
================================================================================================
Install  434 Packages
Upgrade   69 Packages

Total download size: 656 M
$ dnf download strace
  • Configure RPM repositories: Set up, enable, or modify software repository definitions and access remote or local repository sources.
  • Install and Remove RPM Packages: Use DNF or RPM utilities to search for, install, query, verify, and uninstall RPM software packages.
  • Install from Local or Remote Sources: Install software packages directly from the local file system, remote repositories, or the Red Hat Content Delivery Network.
  • Manage Flatpak Packages: Configure Flatpak remote repositories and install, update, or remove Flatpak applications (featured in recent RHEL versions).
  • Persistence After Reboot: Ensure all package management configurations, enabled repositories, and service adjustments persist across system reboots without manual intervention.
  • rh124_dnf.1792855699.txt.gz
  • Last modified: 2026/10/24 15:28
  • by rpjday