0Pricing
Linux Command Line Mastery · Lesson

Package Management (CentOS/Fedora): `yum`, `dnf`, `rpm`

Understand how to manage software packages on Red Hat-based systems with `yum`, `dnf`, and `rpm`.

Package Management (CentOS/Fedora): `yum`, `dnf`, `rpm` is a free Linux Command Line Mastery lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Linux Command Line Mastery learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Intro to Package Management

Welcome to package management on CentOS/Fedora! Software on Linux systems is often distributed in 'packages'.

A package manager helps you install, update, configure, and remove software packages, as well as manage their dependencies (other software they rely on).

On Red Hat-based systems like CentOS and Fedora, we primarily use three tools: rpm, yum, and dnf.

RPM: The Foundation

At its core, all Red Hat-based systems use the Red Hat Package Manager (RPM). Think of rpm as the low-level tool.

It directly handles .rpm files, which contain compiled software and metadata. However, rpm doesn't automatically resolve dependencies.

  • Install: rpm -i package.rpm
  • Query: rpm -q package_name
  • Remove: rpm -e package_name

Querying Packages with RPM

Let's see how to query information about an installed package using rpm. The -q flag is for querying.

rpm -q bash checks if the 'bash' shell is installed. rpm -qi bash gives more detailed information.

rpm -q bash
rpm -qi bash

YUM: Solving Dependencies

Manually managing dependencies with rpm can be tedious. This is where YUM (Yellowdog Updater, Modified) came in.

yum is a higher-level tool built on top of rpm. It automatically searches repositories, resolves dependencies, and installs all necessary packages.

For many years, yum was the standard package manager for CentOS and older Fedora versions.

Installing Software with YUM

Using yum is much simpler for everyday tasks. To install a package, you just need its name.

Let's try installing a simple text editor like nano. You'll often need sudo for installation commands.

sudo yum install nano

Updating & Removing with YUM

yum makes it easy to keep your system updated and manage installed software.

  • Update all: sudo yum update
  • Update specific: sudo yum update package_name
  • Remove: sudo yum remove package_name
  • Search: yum search keyword

These commands handle all dependencies for you!

DNF: The Modern Standard

DNF (Dandified YUM) is the next-generation package manager, now standard in modern Fedora and CentOS Stream/8+.

It's an improved version of yum, offering better performance, more robust dependency resolution, and a cleaner codebase.

The good news? Most yum commands work almost identically with dnf!

DNF Basic Operations

Let's see dnf in action. Its syntax is very similar to yum.

We can use dnf to list available or installed packages, or to install new ones. Try listing all installed packages that include 'nano' in their name.

sudo dnf install nano
dnf list installed | grep nano

Managing Software Groups with DNF

One powerful feature of dnf (and yum) is the ability to manage software groups. These are collections of related packages for common tasks.

For example, you can install a 'Development Tools' group which includes compilers, debuggers, and other utilities.

dnf group list

Package Manager Quiz

Test your knowledge on CentOS/Fedora package managers!

Recap: CentOS/Fedora PM

You've explored the essential package managers for CentOS/Fedora:

  • rpm: The low-level foundation, handles individual .rpm files.
  • yum: The classic high-level manager, resolves dependencies automatically.
  • dnf: The modern, faster, and more robust successor to yum.

Mastering these tools is key to managing software effectively on Red Hat-based Linux systems. Keep practicing!

Frequently asked questions

Is the “Package Management (CentOS/Fedora): `yum`, `dnf`, `rpm`” lesson free?

Yes — the full text of “Package Management (CentOS/Fedora): `yum`, `dnf`, `rpm`” is free to read here on the web, and the Linux Command Line Mastery course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Linux Command Line Mastery course, upgrade to CoddyKit PRO.

What will I learn in “Package Management (CentOS/Fedora): `yum`, `dnf`, `rpm`”?

Understand how to manage software packages on Red Hat-based systems with `yum`, `dnf`, and `rpm`. You practise Linux Command Line Mastery with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Linux Command Line Mastery?

No prior experience is required. Linux Command Line Mastery on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Package Management (CentOS/Fedora): `yum`, `dnf`, `rpm`” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Linux Command Line Mastery lesson?

Yes. Every Linux Command Line Mastery lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Archiving and Compression: `tar`, `gzip`, `bzip2`
  2. Package Management (Debian/Ubuntu): `apt`, `dpkg`
  3. Package Management (CentOS/Fedora): `yum`, `dnf`, `rpm`
  4. Building from Source: configure, make, and make install
← Back to Linux Command Line Mastery