DNF (Dandified Yum) is a modern, efficient package manager for RPM-based distributions like RHEL and CentOS, offering faster performance and better dependency resolution than YUM. This guide simplifies installing DNF on an AvaHost RHEL/CentOS 7 VPS, with practical examples to enhance your server management experience.
AvaHost VPS with RHEL 7 or CentOS 7.
Root access or sudo privileges (see prior SSH guide).
Stable internet connection.
Basic Linux command knowledge.
It’s always recommended to update your system before installing new software. Run the following command to ensure all existing packages are up to date:
sudo yum update -yDNF is not included in the default RHEL/CentOS 7 repositories, so you need to enable the EPEL (Extra Packages for Enterprise Linux) repository:
sudo yum install -y epel-releaseOnce installed, update the repository metadata:
sudo yum update -yNow you can install DNF by running:
sudo yum install -y dnfThis command will install the necessary dependencies and set up DNF on your system.
To confirm that DNF has been installed successfully, check its version:
dnf --versionIf the installation was successful, you should see output similar to:
DNF version 2.x.xSince YUM is still the default package manager in RHEL/CentOS 7, you can replace it with DNF for package management tasks. If you wish to use DNF instead of YUM by default, you can create symbolic links:
sudo mv /usr/bin/yum /usr/bin/yum.bak
sudo ln -s /usr/bin/dnf /usr/bin/yumThis ensures that when you run yum commands, they are redirected to dnf.
You can now use DNF as you would use YUM. Here are some common package management commands:
sudo dnf install package-namesudo dnf remove package-namesudo dnf update -ydnf search package-namesudo dnf autoremove -yInstalling DNF on RHEL/CentOS 7 provides an enhanced package management experience with improved performance and better dependency handling. By following this guide, you can easily install and start using DNF on your system. If you plan to upgrade to a newer version of RHEL or CentOS, you’ll already be familiar with DNF, as it is the default package manager in RHEL 8 and later.