Vol. I · No. 46The command line sectionSat, 10 Oct 2026
Linux · packages & software

dnf

install software on Fedora and RHEL

dnf is the package manager of the Red Hat family. It does the job apt does on Debian: resolves dependencies and installs from signed repositories. The main difference in use is that there is no separate "update the list" step.

On Fedora and RHEL, dnf upgrade is the whole routine update.

Upgrade all
dnf upgrade
refreshes metadata itself
Install
dnf install NAME
with dependencies
Search
dnf search WORD
names and summaries
Undo
dnf history undo
reverses a transaction

At the terminal

Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.

root@netflow — bashdnf
# dnf install tree
1Last metadata expiration check: 0:12:41 ago on Wed 30 Sep 2026 10:29:26 AM IST.
Dependencies resolved.
2 Package Architecture Version Repository Size
Installing:
tree x86_64 2.1.0-4.fc40 fedora 58 k
3Install 1 Package
Total download size: 58 k
4Is this ok [y/N]:
Illustrative session · names, sizes and dates are examples, and every address is from a documentation or private range
Reading the output

What the numbered lines are telling you

1
Metadata is refreshed automatically

dnf checks how old its copy of the package lists is and updates them when needed.

2
The transaction, as a table

Each package with its architecture, version, and the repository it comes from.

3
The summary

What will be installed, upgraded or removed, and how much will be downloaded.

4
It waits for a yes

The capital N is the default: pressing Enter cancels. -y answers yes in advance, for scripts.

Switches

A switch changes how the command behaves. These are the ones used day to day; man dnf lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.

-y
Answer yes to prompts.
--security
With upgrade, apply only security updates.
--refresh
Force the package lists to be downloaded again.
--assumeno
Answer no: show the transaction without doing it.
--enablerepo=NAME
Use a repository that is disabled by default, for this command.
-q
Quiet.

Variations worth knowing

The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.

sudo dnf upgrade

Updates every installed package.

dnf provides /usr/bin/dig

Finds which package supplies a file or command.

dnf history

Lists past install and update transactions.

sudo dnf upgrade --security

Installs only the updates marked as security fixes.

In cybersecurity

The package manager is the trusted path by which software reaches the machine.

Keep signature checking on

gpgcheck=1 in the repository settings makes dnf refuse unsigned packages. Turning it off to "fix" an error removes the protection.

Security-only updates

"dnf upgrade --security" applies fixes without other changes — useful on servers where every change must be justified.

History is an audit trail

"dnf history" records what was installed, when and by which user. Unexpected entries are worth following up.

Protocols it shows

HTTPTLS

Read alongside