USD ($)
$
United States Dollar
Euro Member Countries
India Rupee

Installing and Updating Software with YUM/DNF

Lesson 23/49 | Study Time: 20 Min

YUM (Yellowdog Updater Modified) and DNF (Dandified YUM) are popular package management tools used primarily in Red Hat-based Linux distributions such as Red Hat Enterprise Linux (RHEL), CentOS, and Fedora. These package managers simplify software installation, upgrading, and removal by automating dependency resolution and handling software repositories.

Overview of YUM and DNF

YUM: The traditional package manager used in RHEL and CentOS prior to version 8. It automates package downloads, installations, and updates with dependency management.

DNF: Introduced as the next-generation replacement for YUM, beginning with Fedora 22 and RHEL 8. DNF provides improved performance, better dependency resolution, and a more consistent API.

Despite differences, YUM and DNF share a similar command structure, making the transition seamless for users.

Updating Package Lists

Both YUM and DNF retrieve up-to-date package metadata from configured repositories before any installation or upgrade operation.


Command:

text
sudo yum check-update

or

text
sudo dnf check-update


This fetches the latest package info but does not perform upgrades.

Installing New Software

To install a new package:

text
sudo yum install package_name

or

text
sudo dnf install package_name


Example:

text
sudo dnf install httpd

installs the Apache HTTP server.


To install multiple packages at once:

text
sudo yum install package1 package2

YUM/DNF resolves and installs dependencies automatically.

Updating Existing Software

To upgrade all packages to the latest available versions:

text
sudo yum update

or

text
sudo dnf upgrade

This command downloads and installs package updates from repositories. Users are prompted to confirm before proceeding unless the -y flag is used:

text
sudo dnf upgrade -y

Removing Packages

To uninstall software:

text
sudo yum remove package_name

or 

text
sudo dnf remove package_name

Removes the specified package and optionally unused dependencies.

Searching and Listing Packages

Additional Useful Options


1. Clean Cache:

text
sudo yum clean all
sudo dnf clean all

Clears cached metadata and packages to free space and refresh repositories.

2. History Management: Use yum history or dnf history to view or undo previous transactions.

Transition from YUM to DNF


1. Fedora and RHEL have moved towards DNF for enhanced capabilities.

2. DNF is backward compatible with YUM commands, so most knowledge is transferable.

3. DNF offers improvements in memory usage and extensibility.

Samuel Wilson

Samuel Wilson

Product Designer
Profile

Class Sessions

1- What is Linux and Operating System Concepts 2- Linux History and Evolution 3- Linux Distributions and Their Purposes 4- Open Source Software and Licensing 5- Graphical User Interface (GUI) and Desktop Environments 6- Terminal Access and Command-Line Fundamentals 7- Getting Help and Command Documentation 8- File System Hierarchy and Directory Structure 9- Navigating Directories and Listing Contents 10- Creating, Copying, and Moving Files and Directories 11- Deleting Files and Directories 12- Symbolic and Hard Links 13- Understanding File Permissions Model 14- Modifying Permissions and Ownership 15- User and Group Management 16- Sudo and Privilege Escalation 17- Text Searching and Pattern Matching 18- Text Processing and Stream Editing 19- Compressing and Archiving Files 20- Text Editing and File Creation 21- Package Management Systems Overview 22- Installing and Updating Software with APT 23- Installing and Updating Software with YUM/DNF 24- Managing Software from Non-Repository Sources 25- Understanding Processes and Process Management 26- Viewing Running Processes 27- Process Control and Termination 28- Task Scheduling with Cron 29- Networking Concepts and IP Addressing 30- Viewing and Configuring Network Interfaces 31- Basic Network Troubleshooting 32- Shell Script Basics 33- Variables and Data Types 34- Conditional Logic in Scripts 35- Loops and Iteration 36- Functions and Code Reuse 37- Input/Output and User Interaction 38- System Authentication and Access Control 39- File System Security 40- Software Updates and Patching 41- Basic Firewall Concepts 42- System Information and Monitoring 43- Service and Daemon Management 44- System Boot Process and Runlevels 45- System Backup and Disaster Recovery 46- Comprehensive File System Management 47- System Automation Workflows 48- Multi-Concept Troubleshooting Scenarios 49- Continued Learning Pathways