Package Management

dnf

Next-generation package manager for Fedora and RHEL 8+ replacing yum.

Synopsis

syntax
dnf [OPTION]... COMMAND [PACKAGE]...

Examples

Install Go
sudo dnf install golang
Update all packages
sudo dnf update
Search for Node.js
dnf search nodejs
Remove unneeded dependencies
sudo dnf autoremove

Common options

FlagDescription
installInstall packages
removeRemove packages
updateUpdate packages
searchSearch packages
autoremoveRemove unneeded packages
-yAssume yes

About dnf

The `dnf` command next-generation package manager for Fedora and RHEL 8+ replacing yum. Package management commands install, update, and remove software on Linux distributions.

Each distribution family has its own package manager — apt for Debian/Ubuntu, yum/dnf for RHEL/Fedora, pacman for Arch, and so on. Understanding your distro's package manager is one of the first steps in Linux administration.

The command accepts 6 commonly used flags shown above, though the full set of options is available in the man page (`man dnf`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Package Management Commands

Other commands in the Package Management category

Related tools