How to Install YUM: A Practical Guide for Beginners
Rationale:
YUM (Yellowdog Updater Modified) is one of the most widely used package managers for RPM-based Linux distributions such as CentOS, RHEL, and Fedora. If you find yourself working on a minimal setup or a custom Linux installation where YUM isn’t installed or has been removed, this guide will help you get it up and running quickly. Having YUM installed means you can easily install, update, and remove software packages without fuss.
Hook:
Imagine trying to install software on your Linux box with no package manager—painful, right? Let’s get yum working on your system in no time.
What is YUM?
YUM stands for Yellowdog Updater Modified. It handles software installation and updates by resolving dependencies automatically. Most RPM-based Linux distros come with yum pre-installed, but sometimes you might need to install it manually—especially on minimal installations or in custom Docker containers.
Step-by-Step Guide: How to Install YUM
Step 1: Check if YUM is Already Installed
Open your terminal and run:
yum --version
If it returns a version number, congratulations! Yum is installed.
If the command is not found or you see an error like bash: yum: command not found
, you need to install it.
Step 2: Identify Your Distribution and Use Package Manager Accordingly
- On CentOS or RHEL,
yum
is usually available by default. - On Fedora (from Fedora 22 onwards),
dnf
has replaced yum but yum is still available as a wrapper. - On some minimal installs, you might have
rpm
but notyum
.
If yum is missing, you can try installing it using rpm directly or another method.
Step 3: Install YUM Using RPM (If Yum Missing)
Since yum itself is an RPM package, if you have rpm installed but no yum binary:
- Download the necessary rpm files from a CentOS or RHEL mirror repository that matches your system version.
Example for CentOS 7:
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
Note: Yum depends on python-iniparse among others; be sure to download all required dependencies if they are missing.
- Install them with rpm:
sudo rpm -Uvh python-iniparse-0.4-9.el7.noarch.rpm
sudo rpm -Uvh yum-3.4.3-168.el7.centos.noarch.rpm
This installs Yum without using Yum itself!
Step 4: Verify the Installation
Run:
yum --version
You should now see something like:
3.4.3
This confirms yum is successfully installed.
Bonus Tips
Using DNF Instead of Yum (Fedora / New RHEL Versions)
For newer Fedora or RHEL versions (8+), dnf
replaces yum
. You can install dnf using:
sudo rpm -Uvh https://download.fedoraproject.org/pub/fedora/linux/releases/33/Everything/x86_64/os/Packages/d/dnf-4.x.x-x.fc33.noarch.rpm
(Replace URL/version accordingly.)
Then call packages with dnf
, which has improved performance and features over yum.
Installing Software With Yum
Once installed, installing packages is simple:
sudo yum install nano
This command installs the text editor nano along with all dependencies automatically.
Summary Checklist:
- Check if yum exists (
yum --version
) - If missing, use
rpm
to manually install Yum's RPM package(s) - Download necessary dependencies before installing
rpm -Uvh package.rpm
- Test again after installation
Installing yum manually might seem technical at first but once set up, managing packages becomes effortless!
Got questions about YUM or any Linux package managers? Drop a comment below!
Happy sysadmin-ing!
— Your Friendly Linux Guide