Back to the command reference

dnf

SystemFundamentalsReference only

Package manager for Fedora and RHEL 8+

Name: dnf = Dandified YUM

This command is outside what the site lets you practise (mostly distribution-specific or rarely used tools). This page describes how to use it; try it on your own Linux system.

Description

dnf is the package manager of Fedora and RHEL 8 onward, the successor to yum with nearly the same commands but faster, more reliable dependency resolution.

Syntax

dnf [OPTION]... COMMAND

Common options

install / removeInstall / remove
upgradeUpgrade everything
searchSearch packages by keyword
infoShow a package’s details
providesWhich package provides a file
autoremoveRemove dependencies nothing needs any more
historyThe install history, which can be undone (dnf history undo N)
-yAnswer yes to every question

Examples

  • $ sudo dnf install nginx

    Install nginx

    Explain
  • $ dnf provides /usr/bin/dig

    Which package has dig

    Explain

Related