Hosting + Ai Website Builder + Free Domain (3 Month Free Credit)
Shop Today

Use YUM on Linux for Fast Software Installation [Complete Guide]

Use YUM (Yellowdog Updater, Modified) on a Linux server to manage software packages, such as installing, updating, and removing RPM-based packages on Red Hat Enterprise Linux (RHEL), CentOS, Fedora (older versions), and their derivatives. YUM handles package dependencies automatically and manages software repositories, making package management easier.

YUM on a Linux Server

Note: On modern RHEL-based systems (RHEL 8+, CentOS 8+, Fedora 22+), DNF (Dandified YUM) has replaced YUM, but the yum command often acts as a compatibility layer, forwarding commands to DNF.

This guide explains how to use YUM on Linux servers, including installation if needed, basic commands, and repository management.

Prerequisites

  • A Linux server running RHEL, CentOS, Fedora (older than Fedora 22), or a compatible distribution
  • Root or sudo access to run YUM commands
  • Terminal or shell access

Use YUM on a Linux

YUM (Yellowdog Updater, Modified) is a powerful package manager used in RHEL-based distributions like Red Hat Enterprise Linux (RHEL), CentOS, and some older versions of Fedora. It allows users to install, update, remove, and manage software packages from configured repositories with simple commands.

Using YUM streamlines system maintenance by handling dependencies and keeping packages up to date with minimal effort.

Check if YUM Is Installed

Most RHEL, CentOS, or older Fedora systems come with YUM installed by default:

yum --version

If not installed, you can install it from your package manager (on older distros):

sudo yum install yum

Basic YUM Package Management Commands

Here are the most commonly used YUM commands to manage packages:

  • Update all installed packages:
sudo yum update
  • Install a new package:
sudo yum install package_name
  • Remove/uninstall a package:
sudo yum remove package_name
  • Search for a package by keyword:
yum search keyword
  • Get detailed information about a package:
yum info package_name
  • List enabled repositories:
yum repolist
  • Clean up cached packages and metadata:
sudo yum clean all

Working with Repositories

YUM uses repository files located in /etc/yum.repos.d/ to know where to get packages.

  • To add a new repository, place a .repo file in /etc/yum.repos.d/.
  • To view the enabled repositories:
yum repolist enabled
  • To disable or enable a repository temporarily, add --disablerepo=repoid or --enablerepo=repoid in your YUM commands.
  • Update YUM Itself

To update the YUM package manager and its plugins:

sudo yum update yum

Use YUM with Options

YUM provides various command-line options that give you more control over how packages are installed, updated, or removed. These options help customize behaviors such as skipping broken dependencies, excluding specific packages, or running in non-interactive mode, making it ideal for scripting and automation.

  • Answer “yes” automatically to all prompts:
sudo yum install package_name -y
  • Skip packages causing errors:
sudo yum update --skip-broken
  • Verbose output for troubleshooting:
sudo yum install package_name -v

Notes on YUM vs. DNF

On newer versions of RHEL, CentOS Stream, and Fedora, the traditional YUM package manager has been replaced by DNF (Dandified YUM). Despite this, the yum command still works in many cases because it’s often just a symbolic link to dnf, ensuring backward compatibility for older scripts and workflows.

  • On modern RHEL, CentOS, and Fedora systems, DNF has replaced YUM as the default package manager. However, the yum command often acts as a symbolic link to dnf for backward compatibility.
  • If you are using newer distributions, you may want to learn DNF usage instead, as it offers improvements in speed and better dependency management.
  • If YUM is unavailable and you want to use DNF, install dnf:
sudo yum install dnf

Example: Installing Apache Web Server Using YUM

sudo yum install httpd -y
sudo systemctl start httpd
sudo systemctl enable httpd

Verify:

sudo systemctl status httpd

Conclusion

To use YUM on a Linux server, ensure it is installed (usually by default on RHEL/CentOS 7 and earlier), then use simple commands like yum installyum update, and yum remove to manage your packages and repositories. YUM simplifies dependency resolution and software management in RPM-based Linux distributions. For newer systems, consider using DNF, but the YUM command remains familiar to many administrators.

Himanshu Joshi

Leave a Comment

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

Scroll to Top