• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

dnf Command Examples

by admin

Dandified YUM or DNF is the name of the package management utility. DNF is the next-generation version of YUM. It’s used in RPM-based distributions. DNF was introduced in Fedora 18, and has been the default package manager for Fedora since version 22. In fact, when we run YUM commands in later releases of Fedora, we are actually running dnf in the background. The dnf utility offers, among other things, performance, memory usages, and dependency resolution.

Using dnf to Manage Repositories

1. List all installed repositories, enabled and disabled:

$ dnf repolist --all

2. List enabled repositories:

$ dnf repolist --enabled

3. Show detailed information on enabled repositories:

$ dnf repolist --enabled

4. Add a repository:

$ sudo dnf config-manager --add-repo /etc/yum.repos.d/fedora_extras.repo

5. Enable the repository:

$ sudo dnf config-manager --set-enabled fedora-extras

6. Disable the repository:

$ sudo dnf config-manager --set-disabled fedora-extras

Using dnf to Manage Software

1. Search for a package:

$ dnf search packagename

2. Install a package:

$ sudo dnf install packagename

3. Remove a package:

$ sudo dnf remove packagename

4. Get information about a package:

$ dnf info packagename

5. Install updates:

$ sudo dnf upgrade

6. Get a list of package groups:

$ dnf grouplist

7. Install a package group:

$ sudo dnf groupinstall "package-group"

8. Remove a package group:

$ sudo dnf groupremove "package-group"

Configuration files

/etc/dnf/dnf.conf – DNF configuration file
/etc/yum.repos.d – all repo files

Conclusion

DNF stands for “DaNdiFied YUM.” The syntax of DNF commands are identical to those of YUM making the switch from YUM to DNF easy. DNF can install and remove packages. It can also install updates and provide us with information about installed packages and packages that are available in the repositories and which have not been installed. DNF allows packages that have been signed to be automatically checked to prevent counterfeit packages from installing malware on your Fedora system.

Filed Under: Linux

Some more articles you might also be interested in …

  1. login: command not found
  2. ansible-vault – Encrypts & decrypts values, data structures and files within Ansible projects
  3. xz Command Examples in Linux
  4. cmatrix: Shows a scrolling Matrix like screen in the terminal
  5. cwebp: Compress an image file to a WebP file
  6. How to Setup SSH keys for “passwordless” ssh login in Linux
  7. addr2line: command not found
  8. declare: Declare variables and give them attributes
  9. fprintd-enroll: command not found
  10. lspath Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright