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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

dnf: command not found

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.

If you encounter the below error while running the dnf command:

dnf: command not found

you may try installing the dnf package as per your choice of distribution:

Distribution Command
CentOS yum install dnf
Fedora dnf install dnf

dnf Command Examples

1. check the version of dnf:

$ sudo dnf --version

2. view the repositories on our system by passing the repolist option:

$ sudo dnf repolist

or

$ sudo dnf repolist all

3. view all the available packages on our system, we use the list option:

$ sudo dnf list

4. We can perform searches similar to YUM. For this, we use the search option:

$ sudo dnf search firefox

5. To view which package provides a particular utility, we use the provides option:

$ sudo dnf provides /bin/ksh

6. In addition to this, we can view information for a specific package using the info option:

$ sudo dnf info libreoffice

7. Check for system updates by using the check-update option:

$ sudo dnf check-update

8. To install a package, we use the install option:

$ sudo dnf install firefox

9. Similarly, to remove a package, we use the remove option:

$ sudo dnf remove firefox

10. Remove packages that were only needed to satisfy dependencies:

$ sudo dnf autoremove

11. To see the various dnf commands that were executed, we can use the history option:

$ sudo dnf history

12. Upgrade installed packages to the newest available versions:

$ sudo dnf upgrade

13. Display details about a package:

$ dnf info package

14. Before we update our system, it’s always a good idea to do some housekeeping. We can use the clean all option for this:

$ sudo dnf clean all

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. “No space left on device” – kdump generation issue (CentOS/RHEL)
  2. pi Command Examples in Linux
  3. What is the refid in ntpq -p output?
  4. “az sshkey” Command Examples (Manage ssh public keys with virtual machines)
  5. How to configure xhost to be persistent across reboots in Linux
  6. sestatus Command Examples in Linux
  7. CentOS / RHEL 7 : How to install kernel from rescue mode
  8. Beginners Guide to yum Configuration
  9. CentOS/RHEL7 – Tuned Profiles Oracle
  10. rofi Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • ctags: Generates an index (or tag) file of language objects found in source files for many popular programming languages
  • csvtool: Utility to filter and extract data from CSV formatted sources
  • csvstat: Print descriptive statistics for all columns in a CSV file
  • csvsql: Generate SQL statements for a CSV file or execute those statements directly on a database

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright