The Wayback Machine - https://web.archive.org/web/20240829013116/https://www.geeksforgeeks.org/what-is-fedoras-dnf-package-manager-and-how-to-use-it/
Open In App

What is Fedora’s DNF package manager and how to use it?

Last Updated : 25 Apr, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

A package manager is a program that helps you to manage and install and manage apps and their dependencies on a system. While Debian-based systems have dpkg and APT as their package managers and Arch-based systems have Pacman, Fedora-based systems use DNF.

What is DNF?

DNF or Dandified YUM is the package manager of Fedora and Fedora derivatives and is the successor of Yellow-dog Updater Modified or YUM package manager. It is used to manage packages, i.e. install, upgrade, update, reinstall, and uninstall them among other things. DNF has been the default package manager of Fedora since version 22 (2015) and it was first introduced in version 18 in 2013.

DNF vs RPM

RPM is also a package management system in Fedora and DNF works on top of it. Fedora’s documentation pushes users towards DNF instead of using RPM, as it is not capable of automatically finding and installing dependencies of a package, which means users will have to manually find and install them.

Today we will learn how to use the DNF package manager; i.e. You would learn how to install, search, uninstall, and do more things using it.

Structure of command

The basic structure of the command is

DNF [options] COMMAND

Basic and most frequent commands

Search packages

This command is used when you want to search Fedora repositories for a given package, after entering this command it will show all the available packages in the repository which match the search term, it searches within the name first, then searches for matches in name and summary. It is similar to how you search for packages in graphical stores.

To search for a package, you need to enter the “search” command along with the package that you want and it will show you all available packages matching that query:

dnf search [package name]
An image showing searching of an app using dnf-gfg

DNF search

Installing packages

The “install” command will help you to install packages from the repositories. You can use this command to install one or multiple packages, to install multiple packages you just have to type the name of the packages with a space in between them. This command requires sudo privileges.

To install one package

sudo dnf install [[package name]]
an image showing installation of an app using dnf_gfg

using DNF to install one package

To install multiple packages

sudo dnf install [[package 1]] [[package 2]] [[package 3]] ..... [[package n]]
An image showing the installation of multiple apps using dnf_GFG

Installing multiple packages using DNF

Upgrading packages and system

Nobody likes old packages, so if you want to update your system along with its packages you can use the “upgrade” command. Sudo privileges are required.

sudo dnf upgrade
An image showing upgrading using DNFGFG

Upgrading using DNF

Upgrade a specific package

to upgrade a specific package you need to type

sudo dnf upgrade [[package name]]
An image showing upgrading individual package using DNF-gfg

Upgrading individual package using DNF

Listing available updates

To check for available package updates without installing them you should enter:

dnf check-update
An image which shows the checking of update using DNF-GFG

Checking for updates using DNF

Removing packages

A package broke your computer or maybe you don’t need it anymore, in that case, you can use the “remove” command to uninstall applications from the system, this is equivalent to the “remove” command in Debian-based systems. This also needs sudo privileges to run.

sudo dnf remove [[package name]]
An image showing removal of an app using dnf-gfg

Removing packages using DNF

Removing multiple packages

To remove multiple packages you should enter the name of each package separated by a space.

sudo dnf remove [[package 1]] [[package 2]] [[package 3]] ..... [[package n]]
An image showing the removal of multiple apps using dnf-GFG

Removing multiple packages using DNF

Removing unused dependencies

You uninstalled the package but it still has a lot of leftovers in your system in the form of dependencies, you don’t have to worry, just use the “autoremove” command to remove all the dependencies left behind in the system. You need to have “sudo” privileges for this command to work.

sudo dnf autoremove
An image showing the removal of leftover dependencies using DNF-GFG

Auto-removing leftover dependencies using DNF

Reinstalling packages

You accidentally broke a package (it happens ok!) or it just started acting up, you can easily reinstall it using the following command.

sudo dnf reinstall [[package name]]
An image showing dnf reinstall command-GFG

Reinstalling using DNF

Listing packages

To list all the available packages in the repository (for some reason if you just want to do that! you do you.) you could enter the following command

dnf list

Listing the packages you installed

The “dnf list” command will list all the available packages in the repository, but most of the time that is of no use to us; to list only the packages that you installed you could use the”–installed” option along with the “list”

dnf list --installed
an image showing the dnf-list-installed command_gfg

Listing installed apps

Searching within the list of installed apps

Even, “dnf list –installed” would yield so many results, if you want to further narrow down your options you could use the “grep“ command with it, the “grep” command searches for a value within the output.

You could use grep command in combination with the list command like this:

dnf list --installed | grep [[package name]]
An image showing searching of a particular package in the installed packages-gfg

Searching for a particular package in the installed packages

Want more help? No worries

The “help” option will help (ahm) you, it will list all the basic commands you possibly might need.

To use it enter the following command into the terminal.

dnf --help

if you have a more specific use case, you can always read the man pages of DNF using:

man dnf

Some Examples of installing popular apps using DNF

  • Installing Firefox
sudo dnf install firefox
  • Installing VLC media player
sudo dnf install vlc
An image showing the installation of VLC media player using dnf-GFG

An image showing installation of VLC

  • Installing GIMP
sudo dnf install gimp
An image showing the installation of gimp using dnf-GFG

Installing GIMP

Conclusion

Thats it! Now you know all the basic DNF commands to install, update, uninstall and do other things with apps. All you need to do now is to just open the terminal and start managing those nice packages with the new skills that you just learned. Let us know about the DNF commands you use most frequently in the comments. You can learn more about DNF in Fedora documentation or you could always read the man pages of DNF.



Similar Reads

dnf Command in Linux
Linux is a versatile operating system. It has many commands that can change the Linux working functionality of the operating system. Every Linux has a different package manager that helps us to install the software in the Linux operating system. The `dnf` command is a package manager command in Red-based Linux distros for example fedora, Cent OS an
4 min read
Using Synaptic Package Manager to Download a Package in Linux
Synaptic package manager is GTK-based graphical user interface based on Advanced Package Tool, or APT for download or removes packages on Debian based system like Ubuntu. We can download packages by using the apt command, but the GUI interface is always user-friendly and easy to use. To install synaptic package manager run the following command on
3 min read
How to Install and Use SQLite in Fedora Linux
SQLite is a versatile, lightweight, serverless, and self-contained database engine that finds applications in a variety of settings, ranging from embedded systems to mobile applications and serverless environments. In this article, we will delve into the installation and usage of SQLite on a Fedora Linux system. We will cover installation steps, ho
4 min read
Difference Between Ubuntu and Fedora
Ubuntu is a Linux based Operating System and belongs to the Debian family of Linux. As it is Linux based, so it is freely available for use and is open source. It was developed by a team "Canonical" lead by Mark Shuttleworth. The term "ubuntu" is derived from an African word meaning ‘humanity to others’. The Chinese version of Ubuntu is used for ru
2 min read
Difference Between Fedora and Kali Linux
Fedora OS, developed by Red Hat, is a Linux based open-source operating system. As it is Linux based, so it is freely available for use and is open source. It uses the DNF package manager and gnome environment along with anaconda installer. It supports 3 platforms, which are Workstation Fedora designed for Personal Computers, Fedora Server designed
2 min read
Creating and Running a Fedora Linux Live USB stick on a PC with Windows 11
This article presents a brief overview of the Fedora operating system, describes what live boot is, and then shows how to create a live bootable USB drive and then run a live version of the operating system on a PC with Windows 11 (Home). Overview of FedoraFedora Linux is a popular free and open-source operating system (Linux distribution) develope
6 min read
How to Install Tilix Terminal Emulator in Ubuntu/Fedora/Arch Linux?
A terminal emulator is a software that helps in interacting with the computer machine and perform operations using commands. Tilix is a tiling terminal emulator formerly known as Terminix. It is an enhancement over a regular terminal and provides some important features. Features of Tilix Terminal Emulator: Enable users to split the terminal into d
3 min read
How to Install MySQL on Fedora?
MySQL is one of the oldest and most reliable open-source (Available to all) Relational Database Management Systems. Trusted by Millions of users. SQL is used to communicate with Oracle, SQL-Server & MySQL. In MySQL, all data are arranged in the form of a table. MySQL is one of the best RDBMS being used for developing various web-based software
4 min read
How to setup Timeshift with BTRFS in Fedora?
If you truly are a geek at heart, you've ended up with a broken system at least once in your life and yes while it can be enjoyable to troubleshoot the issues and correct them, more often than not you will simply be reinstalling your entire OS and its never that fun at all having to go through all that tedium - downloading and installing all your a
6 min read
How to Download Zoom in Fedora?
Fedora, known for its bleeding-edge technology and focus on open-source software, offers a fantastic user experience. But sometimes, the need arises to connect with colleagues or friends using popular platforms like Zoom. Fear not, Fedora users! This guide will walk you through the straightforward process of downloading and installing Zoom on your
3 min read
How to Install Apache Web Server in Linux: Ubuntu, Fedora, RHEL?
Setting up the Apache Web Server on Linux operating systems such as Ubuntu, Fedora, and RHEL is a routine job for web developers and system managers. Apache stands out among web servers for its adaptability, robust security measures, and compatibility with different web technologies. This manual will guide you through the installation process of Ap
4 min read
How to Install and Configure Synaptic Package Manager in Ubuntu?
Synaptic Package Manager is a GUI based package management tool that uses APT (Advanced Package Tool) to installing, updating or removing packages from the Linux system. Some of the feature given by Synaptic Package Manager are: Allow installing, updating or removing packagesUpgrading whole systemSearching and filtering the list of packages availab
1 min read
How to Convert .rpm package to .deb using alien Package Converter?
Most of the time there are packages (in repositories and GitHub) that are ready to use. But sometimes packages are not available in binaries (ready to install on the go) we have to download the source code and build from scratch. This is not an issue if you have time but for increasing Productivity. Here is where Alien (package converter) comes int
2 min read
sysget - Front-End For Every Package Manager in Linux
There are lots of package managers for various Linux distros, for example, apt (Ubuntu), yum (legacy Fedora), dnf (Fedora) but remembering them all is quite a headache. So for that reason, there is a utility called sysget, which is a front-end for every package manager in Unix-like operating systems. So that you don't need to learn about every pack
2 min read
How to Uninstall Packages With Apt Package Manager in Linux
The apt command is a sophisticated command-line tool that interacts with Ubuntu's Advanced Packaging Tool (APT) to execute tasks including installing new software packages, updating the package list index, and even upgrading the whole Ubuntu system. Along with this, we can uninstall or remove the downloaded packages from the system. So in this arti
2 min read
Nix - The Purely Functional Package Manager for Linux
Nix is a purely functional package manager for Linux, that serves to provide a purely functional approach to any system's software package management. Due to its functional and declarative approach, it is lauded for its capacity to: Support the installation of multiple versions of a given package.Enable atomic upgrades and rollbacks of a given pack
5 min read
How to Install a New Package Manager in Linux
Linux offers several package managers for software installation, updates, and maintenance. In Linux, every distribution comes with a package manager by default. The Debian distribution comes with APT(Advanced Package Tool), Red Hat, and its derivatives such as CentOS and Fedora use YUM package management.However, there may be cases when you need to
4 min read
Snap Package Manager on Ubuntu
Snap is a package management system and software deployment. Generally, these packages are termed as snaps. The tool for using snaps is termed as the snap. Snaps are app packages for cloud, IoT and desktop that are easy to install, and cross-platform. Snaps works across all the Linux distributions so it activates the utilities and latest apps for t
4 min read
How to Use Package Managers in Linux? APT and YUM
Package managers like APT and YUM are essential tools for managing software on Linux systems. They allow you to install, update, and remove packages easily, ensuring your system is up-to-date and secure. APT is commonly used in Debian-based distributions like Ubuntu, while YUM is used in Red Hat-based distributions like CentOS and Fedora. This guid
5 min read
How to Use Midnight Commander, a Visual File Manager
For Unix-like systems, Midnight Commander (MC) is a potent visual file manager with an easy-to-use interface for organizing and managing files and directories. It is perfect for distant servers and systems without graphical user interfaces because it functions in a text-based environment. The fundamentals of using Midnight Commander to manage files
6 min read
Understanding Package Managers and systemctl
A package manager is a command-line or graphical tool used to automate the process of installing, updating, and removing software packages on a Linux system. Software packages are collections of files, including executables, libraries, configuration files, and documentation, that are bundled together for easy distribution and installation. Package
9 min read
How to Install SimpleJson Package for Python in MacOS?
SimpleJson is an open-source Python package. It is a fast, simple, and extensible Python JSON encoder and decoder. The encoder can be customized to provide serialization in any case without special support for serializing objects. For this purpose, the dump should be used as the default parameter. The decoder can handle any encoded JSON string (def
2 min read
How to Install apt-listchanges package on Ubuntu?
Upon collecting the appropriate items from the Debian changelog and NEWS files, the utility apt-listchanges may compare a new version of a package with the one presently installed and display what has changed. It may be run on multiple.deb archives at once to get a list of all changes that would result from installing or updating a set of packages.
3 min read
How To Install apt-offline package on Ubuntu?
Apt-offline adds offline package management features to Debian-based systems. It may be used to download packages and dependencies that will be installed later (or necessary to update) in a disconnected system. Packages can be downloaded from another connected PC. It may also get bug reports for the downloaded packages. Apt-offline is an Offline AP
3 min read
How To Install apt-mirror package on Ubuntu?
This is a tiny utility that allows you to mirror any (or all) of the Debian and Ubuntu GNU/Linux distributions, as well as any other apt sources generally offered by open source developers. This tutorial will walk you through the process of setting up repository mirrors for Ubuntu 20.04 and Ubuntu 18.04. The same procedure applies to each previous
2 min read
How to Install alsa-source package on Ubuntu?
This package provides the ALSA driver source code. Using the m-a utility, the source code can be compiled into an alsa-modules package (available in the module-assistant package). Please keep in mind that the kernel headers are required to compile these modules. For additional details on loading and creating modules, please see the README.Debian fi
2 min read
How to Install alsa-base package on Ubuntu?
Simply ALSA is made up of two parts: a kernel API that allows higher-level sound servers and apps to access your sound card, and a userspace library that provides more generic functionality (like effects, mixing, routing, etc.)In terms of the kernel API, there is no method to "replace" ALSA. OSS (Open Sound System) was previously available, however
2 min read
How to Install apt-transport-https package on Ubuntu?
Apt-transport-https is a fake transitory package; in 1.5, https support was relocated into the apt package. It is safe to remove. This is a fake transitory package; in 1.5, https support was relocated into the apt package. It is safe to remove. This is a fake transitory package; in 1.5, https support was relocated into the apt package. It is safe t
3 min read
How to Install 9Menu package on Ubuntu?
9Menu produces a window that is made up entirely of a menu. The associated command is carried out when a certain item is selected. With the help of this straightforward software, you may make X menus from the shell, each of which will execute a command. Although 9menu is designed to work with 9wm, it may also be used with other window managers. A l
2 min read
How to Install Menulibre package on Ubuntu?
A dynamic menu editor is called MenuLibre. It has an easy-to-use interface that makes it possible to manage and configure the desktop applications you have installed. You may add program launchers to your desktop using Menulibre so that you can access them whenever you want. Let's learn how to install Menulibre on Ubuntu 20.04. On Ubuntu 20.04, the
2 min read