dnf Command: Tutorial & Examples

Install, remove, and manage software packages on Fedora-based systems

dnf (Dandified Yum) is a package manager for Linux systems that use the RPM Package Manager. It is similar to the popular yum command, and is used to install, update, and remove packages on the system.

dnf can be used to perform a variety of package management tasks, such as:

  • Installing a new package: dnf install package_name
  • Updating a package: dnf update package_name
  • Removing a package: dnf remove package_name
  • Searching for a package: dnf search package_name
  • Listing all installed packages: dnf list installed
  • Listing all available updates: dnf check-update

dnf uses a repository-based approach to package management, which means that it retrieves package information and software from remote repositories. These repositories are configured in the /etc/dnf/dnf.conf file, and can be added, removed, and enabled/disabled as needed.

dnf also has a command-line option --best that performs a "best match" algorithm when searching for and installing packages. This option will install the package with the highest version number and best architecture match.

dnf is the default package manager for Fedora and is available as an alternative package manager for other distributions such as Red Hat, Centos, and Oracle Linux. It's considered as a more modern, enhanced and improved version of yum.

Except where otherwise noted, content on this site is licensed under a CC BY-SA 4.0 license CC BY SA