$linuxjunkies
>

dnf(8)

DNF is a package manager for Linux systems that installs, updates, and removes software packages from configured repositories.

UbuntuDebianFedoraArch

Synopsis

dnf [OPTION]... COMMAND [ARGS]...

Description

DNF (Dandified Yum) is the default package manager for Fedora, RHEL 8+, and CentOS Stream. It resolves dependencies automatically, manages package repositories, and provides a more efficient alternative to its predecessor Yum with better performance and dependency resolution.

DNF organizes software into packages that can be installed from remote repositories or local sources. It maintains a local cache of package metadata and can perform bulk operations like system upgrades and package removals with automatic dependency handling.

Common options

FlagWhat it does
installInstall one or more packages by name
removeRemove installed packages and their dependents
upgradeUpgrade all packages to the latest versions available
searchSearch for packages by name or description
infoDisplay detailed information about a package
-y / --assumeyesAutomatically answer 'yes' to prompts, useful for scripts
-q / --quietMinimize output from the command
list installedList all currently installed packages
clean allRemove all cached packages and metadata
check-updateCheck for available package updates without installing
group listDisplay available package groups
--repo=REPOOperate on a specific repository

Examples

Install the vim text editor package

sudo dnf install vim

Upgrade all installed packages to latest versions

sudo dnf upgrade

Search for packages matching 'nginx' in repositories

dnf search nginx

Show detailed information about the python3 package

dnf info python3

Remove the httpd (Apache web server) package

sudo dnf remove httpd

List all installed packages containing 'python' in the name

dnf list installed | grep python

Check which installed packages have available updates

dnf check-update

Automatically install the development-tools package group

sudo dnf install -y @development-tools

Related commands