DEV Community

Naval Kishor Upadhyay
Naval Kishor Upadhyay

Posted on

YUM vs RPM: Understanding Package Management in Linux

Introduction

When you install software on Linux, you don’t always download it from a website like on Windows or macOS. Instead, Linux uses package managers.
On Red Hat–based systems (like RHEL, CentOS, Fedora), the two main tools are RPM and YUM. They work together but solve different problems.


1. What is RPM?

RPM (Red Hat Package Manager) is the low-level tool for handling software packages.

  • A package is usually a .rpm file that contains the software and metadata about it (version, dependencies, etc.).
  • RPM can install, remove, or query a package directly.

Examples

rpm -ivh mypackage.rpm   # installs a package
rpm -e mypackage         # removes a package
Enter fullscreen mode Exit fullscreen mode

⚠️ Problem: RPM does not automatically resolve dependencies. If software A needs software B, you must install B yourself.


2. What is YUM?

YUM (Yellowdog Updater, Modified) is a higher-level tool that builds on RPM.

  • It automatically resolves dependencies.
  • It downloads required packages from repositories (online or local package collections).
  • It simplifies updates and upgrades.

Examples

yum install nginx   # installs nginx plus everything it needs
yum update          # updates all packages to their latest versions
Enter fullscreen mode Exit fullscreen mode

Think of YUM as the smart assistant that talks to RPM for you.


3. How They Work Together

  • RPM is like a mechanic’s toolbox — powerful but manual.
  • YUM is like the garage service desk — you just say what you want, and it organizes the tools, parts, and steps for you.

In fact, when you use YUM, it uses RPM underneath to actually install or remove the package. YUM just makes it easier.


4. Why It Matters

  • RPM alone → better if you have a single .rpm file and know what you’re doing.
  • YUM → better for day-to-day use because it handles dependencies and updates.
  • Both together make Linux package management reliable and scalable for servers.

5. Example Scenario

You want to install httpd (Apache web server):

  • With RPM: you need to find the .rpm file, check dependencies manually, and install them one by one.
  • With YUM: you run yum install httpd, and it automatically installs httpd plus all required libraries.

Conclusion

  • RPM = the foundation (basic tool for installing/removing packages).
  • YUM = the helper (manages dependencies and repositories). Together, they make Linux software installation smooth and efficient.

Top comments (0)