- Posted on
- • Administration
Basics of yum and dnf for RHEL-based distributions
- Author
-
-
- User
- Linux Bash
- Posts by this author
- Posts by this author
-
Mastering Package Management: Basics of YUM, DNF, and Beyond for Linux Users
When diving into the realm of Linux, one of the fundamental skills to master is package management. Linux distributions rely on package managers to install, update, remove, and manage software. This blog focuses on YUM and DNF, predominantly used in Red Hat Enterprise Linux (RHEL) and its derivatives like CentOS and Fedora. Additionally, we'll touch on APT and Zypper, used in Debian-based systems and SUSE Linux distributions, respectively.
Understanding YUM and DNF
What is YUM?
YUM (Yellowdog Updater Modified) is an open-source command-line package-management utility for computers running Linux using the RPM Package Manager. Although YUM has been a reliable tool for RHEL and CentOS for many years, it is being gradually replaced by DNF.
What is DNF?
DNF (Dandified YUM) is the next-generation version of YUM. It has been the default package manager since Fedora 22 and RHEL 8. DNF aims to improve performance and make package dependency resolution more efficient.
Basic Operations with YUM and DNF
Both YUM and DNF share similar commands, making it easier for users switching from one tool to the other. Here’s a quick guide to get you started:
Installation of a Package
sudo yum install package_name # For YUM
sudo dnf install package_name # For DNF
Updating All Packages
sudo yum update # For YUM
sudo dnf upgrade # For DNF
Note: The 'upgrade' command in DNF does the same as 'update' in YUM.
Removing a Package
sudo yum remove package_name # For YUM
sudo dnf remove package_name # For DNF
Searching for a Package
sudo yum search keyword # For YUM
sudo dnf search keyword # For DNF
Checking Information About a Package
sudo yum info package_name # For YUM
sudo dnf info package_name # For DNF
A Peek into APT and Zypper
While YUM and DNF are staples for RHEL-based systems, let’s briefly overview the primary tools used in other popular Linux distributions.
APT (Advanced Package Tool) – Debian and Ubuntu
APT is the package manager for Debian-based systems, including Ubuntu. It is known for its simplicity and effectiveness.
Common APT Commands
Installing a package:
sudo apt-get install package_name
Updating package list:
sudo apt-get update
Upgrading all packages:
sudo apt-get upgrade
Removing a package:
sudo apt-get remove package_name
Zypper – openSUSE and SUSE Linux Enterprise
Zypper is a command-line interface to ZYpp, the package manager for openSUSE and SUSE-based systems. It’s known for its robustness and extensive features.
Common Zypper Commands
Installing a package:
sudo zypper install package_name
Updating all packages:
sudo zypper update
Searching for a package:
sudo zypper search keyword
Removing a package:
sudo zypper remove package_name
Final Thoughts
Understanding the basics of various package managers can significantly enhance your proficiency in managing Linux systems. Whether you are using RHEL, Fedora, Debian, Ubuntu, or openSUSE, knowing how to maneuver through different package managers is a vital skill in the Linux ecosystem. Embrace the commands and the power of Linux package management to maintain and optimise your systems efficiently.
Remember, while this guide provides a foundation, always refer to the official documentation of each package manager for more detailed information and advanced usage scenarios. Happy computing!