How to use the DNF package manager

If you've migrated to Fedora Desktop or Server and want to get up to speed with the DNF package manager, Jack Wallen gives you the basics.

Are you a Fedora desktop or server user? If so, did you know that the distribution has migrated to a new package manager? That's right, instead of yum being the default command line tool for installing applications, the new kid in town is called DNF. DNF stands for Dandified Yum and was introduced way back in Fedora 18 and became the default in Fedora 22.

For those who have yet to try it (because yum still exists on the distribution and habits are hard to break), DNF automatically computes dependencies and determines the actions required to install packages. DNF also makes it easier to maintain groups of packages, eliminating the need to manually update each related package using rpm.

SEE: System update policy template download (Tech Pro Research)

How to use DNF

But how do you use DNF? It's actually very similar to that of YUM. Let's take a look at the basics of using DNF. The basic usage of DNF is dnf option package. Say you want to install rkhunter on your Fedora Server platform with DNF. To do this, issue the command sudo dnf install rkhunter. To remove the same package, issue the command sudo dnf remove rkhunter.

What if you want to update your Fedora Server installation? DNF allows you to do that as well. Issue the command sudo dnf update, and you're good to go.

Install groups

DNF also allows you to easily install via groups. To find out what groups are available, issue the command sudo dnf group list. Find the group you want to install and issue the command sudo dnf group install GROUPNAME (Where GROUPNAME is the group to be installed). For example, installing the Web Server group can be accomplished with the command sudo dnf group install "Web Server".

Make sure to place multi-word group names in quotes, otherwise DNF will error out. And that's pretty much the gist of using DNF. There is quite a bit more to it, so issue the command man dnf to learn more. Happy package managing.

Also see

Image: Fedora

About Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website

Editor's Picks

Free Newsletters, In your Inbox