Understanding YUM and DNF Package Manager in Rocky Linux 8

Introduction

In Rocky Linux 8, the traditional YUM (Yellowdog Updater, Modified) has been replaced with DNF (Dandified YUM). Although the command yum still works for compatibility, it is now redirected to dnf. Understanding YUM/DNF is very important for Linux administrators because it is the backbone of package management in RHEL-based distributions like Rocky Linux, CentOS, and Fedora.

What is YUM?

YUM is a command-line tool for managing packages. It allows administrators to install, update, remove, and search for software packages from configured repositories. YUM automatically resolves dependencies, making package management easier than manually installing RPMs.

What is DNF?

DNF (Dandified YUM) is the next-generation version of YUM. It is faster, more reliable, and uses fewer system resources. It is written in Python and C, providing better performance and dependency management.

Key Differences Between YUM and DNF

  • DNF is faster and uses less memory.
  • Better dependency resolution compared to YUM.
  • Uses the libsolv library for solving dependencies.
  • Support for modular repositories.
  • More consistent API for plugin and tool development.

Basic YUM/DNF Commands

Here are some important commands you can teach your students:

# Install a package
dnf install httpd

# Remove a package
dnf remove httpd

# Update all packages
dnf update -y

# Search for a package
dnf search nginx

# List all installed packages
dnf list installed

# Get package info
dnf info httpd

# Clean cache
dnf clean all

Configuring YUM/DNF Repositories

Repositories are configured inside the /etc/yum.repos.d/ directory. Each repository file ends with .repo and looks like this:

[baseos]
name=Rocky Linux $releasever - BaseOS
baseurl=http://mirror.centos.org/rocky/$releasever/BaseOS/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

Students can practice creating their own repositories or connecting to remote mirrors. This helps in understanding how software delivery works in enterprise Linux systems.

Advanced YUM/DNF Topics to Teach Students

  • Creating a Local YUM Repository: Useful when internet is not available.
  • Using Group Packages: For example, dnf groupinstall "Development Tools".
  • Module Streams: DNF supports application streams which allow multiple versions of software to be installed.
  • History and Rollback: DNF keeps transaction history. You can undo a previous operation using dnf history undo.
  • Automatic Updates: Teaching how to schedule automatic updates with DNF plugins.

Practical Lab Ideas for Students

  1. Set up a Local YUM Repository using Rocky Linux ISO.
  2. Configure a custom repository inside /etc/yum.repos.d/.
  3. Practice installing, updating, and removing packages.
  4. Experiment with group packages and module streams.
  5. Enable and disable repositories on demand.

Conclusion

YUM/DNF is one of the most important topics for Linux system administrators. By learning how to configure repositories, install software, manage updates, and troubleshoot dependency issues, students will gain strong foundational skills. As Rocky Linux 8 and 9 move forward, DNF will continue to be the default package manager, and mastering it is a must for any Linux professional.

Leave a Reply

Your email address will not be published. Required fields are marked *