Categories: Package Management

dnf command on Linux (Installing and updating packages) [Basic Guide]

Linux distributions based on Red Hat use package manager called Red Hat Package Manager — RPM to install your software. Among the most famous distributions are Red Hat’s own Linux Enterprise, Fedora, and CentOS.

RPM is a powerful package manager that allows the administrator to install, remove, and obtain package information. It is a software distribution method widely used in several Linux distributions, in addition to Red Hat.

It also makes it possible to build packages from source files, verify the digital signature, simulate an installation of programs, among others. It’s as powerful as dpkg and apt-get.

The Linux distribution Fedora made its own package manager based on Red Hat, called DNF.

DNF is a software package manager that installs, updates, and removes packages in RPM-based Linux distributions, much like YUM.

It automatically calculates dependencies and determines the actions required to install packages.

DNF also makes it easy to maintain groups of machines, eliminating the need to manually update each one using rpm.

Introduced in Fedora 18, it has been the standard package manager since Fedora 22.

For many, DNF or “Dandified Yum” is the next generation version of Yum.

It maintains the compatibility of the Yum interface and defines a strict API for extensions and plugins. The fact that it allows the installation of plugins is very welcome, as they can modify or expand the features of the DNF and provide additional interface commands.

dnf installation

If DNF isn’t installed on your Red Hat-based distribution, you can do so using Yum:

# yum install dnf

The commands that DNF accepts are very similar to Yum:

  • autoremove: removes a package and its dependencies (only if not used by other programs)
  • check: Checks the RPM database and produces check-update information
  • [package name]: Checks for package updates
  • clean: Delete temporary files from the
  • distro-sync repositories: Upgrade or downgrade packages to keep them the same as the latest version of the repository
  • downgrade [package name]: downgrade a group package
  • [info] [install] [list ] [remove] [upgrade]: Perform commands with software
  • history groups: list the transactions performed
  • info [package name]: shows information about a package install package_name
  • : install a particular package and its dependencies
  • list: list the installed and available packages
  • provide [name]: list the packages containing the requested name
  • remove package_name: remove a particular package repolist
  • : list known repositories
  • upgrade [package name]: upgrade one package or all if the package name is not specified

Examples of using DNF are very similar to YUM, since DNF is considered an evolution of YUM.

Conclusion

Whether you use Fedora or Red Hat, the dnf command is essential for managing packages in these distributions.

Uirá Endy Ribeiro

Uirá Endy Ribeiro is a Software Developer and Cloud Computing Architect with a 23-year career. He has master's degrees in computer science and fifteen IT certifications and is the author of 11 books recognized in the IT world market. He is also Director at Universidade Salgado de Oliveira and Director of the Linux Professional Institute - LPI Director's Board.

Uirá Endy Ribeiro

Uirá Endy Ribeiro is a Software Developer and Cloud Computing Architect with a 23-year career. He has master's degrees in computer science and fifteen IT certifications and is the author of 11 books recognized in the IT world market. He is also Director at Universidade Salgado de Oliveira and Director of the Linux Professional Institute - LPI Director's Board.

Recent Posts

Sudo command on Linux (privilege scale) [Basic Guide]

The sudo command on Linux executes a given command as if it were another user.…

2 years ago

SS command on Linux (investigate the network) [Basic Guide]

The ss command on Linux is extremely useful for investigating sockets, providing various information about…

2 years ago

Free Linux command (memory usage) [Basic Guide]

Free Linux command shows the amount of total memory in use and available, as well…

2 years ago

Linux while command (loop – while) [Basic Guide]

The shell has structures for testing conditions and executing certain program sequences several times (loop),…

2 years ago

Linux fstab file (disk mount setup) [Basic Guide]

The /etc/fstab file stores the configuration of which devices should be mounted and what is…

2 years ago

Netcat command on Linux (Swiss network knife) [Basic Guide]

The Netcat Command in Linux or nc is a utility used to do “almost anything”…

2 years ago

This website uses cookies.