Getting Started With DNF Package Management

Linux operating systems have a centralized way of searching, installing, updating, and deleting software. In this document, I want to talk about the DNF package management system.

Introduction

They usually kept pieces of software as packages. They keep these packages in repositories, which are storage locations that hold all the files for any piece of software. When you interact with software packages, this is called package management.

You can do a lot with packages, not only install things. It is very common to search first. If I need some software, I can search for the term from the package management system. The system will give me a list of packages that it has and from there I can select what I want. Updating and deleting software happens from within the package management system.

It is smart to use package management because it is more secure. How many times have you searched for something and seen 5 results and not knowing which is the right one? This is because many people try to replicate another site so they can get you on their site. You do not want this. It is how they steal your bank information and passwords. Therefore, it is safer to use package management. Someone has already vetted these packages.

DNF

We use the DNF package management system in several distributions. These include Fedora, RHEL, and Rocky Linux. DNF uses RPM files. This stands for Red Hat Package Manager file. They make it easy to work with packages since everything is packaged. You can only use these files on Linux systems, but you can use archive tools to look inside and see the files.

Updating Packages

This is the process you will do the most of. You typically only install something once, but you want to update it often. What if you have 20 different softwares on your machine? Without a package manager, go to each website and download the latest version and then run it. Using DNF, you can enter a single command in your terminal to update any single application or all at once.

dnf update all

This will update all your packages at once if you want to do that. If you want to update a single package at once, you can do this:

dnf update firefox

If you are not sure what the package is called, you can use the search function.

dnf search atom

Then select the package you want to install. If you are not sure it is the right package, you can get the information on it.

dnf info firefox

Once you know the right name for the package you want, you can install it.

dnf install firefox

Now, if you want to remove a package, you can do that easily too.

dnf erase firefox

Sometimes, you will have questions and wonder what the correct syntax is. There is help for any command.

dnf help

Conclusion

This document gives you an overview of the DNF package management system. It is very convenient to use. We accomplish installing and updating software like this. There is a lot more you can do with it.

This article was updated on June 24, 2022