Linux Package Management with DNF: Complete Beginner's Guide to Installing and Managing Software

Learn how to use DNF package manager to install, update, and manage software on RHEL, CentOS, and Fedora. Master dnf list, dnf info, dnf changelog with detailed examples for absolute beginners.

15 min read

Managing software on Linux systems is one of the most important skills for any system administrator or user. DNF (Dandified YUM) is the modern package manager for RHEL, CentOS, and Fedora systems that makes installing, updating, and managing software incredibly straightforward.

💡

🎯 What You'll Learn: In this comprehensive tutorial, you'll discover:

  • Understanding what package managers are and why they matter
  • Using dnf list to check installed packages
  • Getting detailed package information with dnf info
  • Viewing package changelogs with dnf changelog
  • Understanding repository synchronization
  • Reading and interpreting package metadata
  • Installing, updating, and removing packages
  • Best practices for package management

📦 What is DNF?

DNF (Dandified YUM) is a package manager that handles installation, updating, and removal of software packages on RPM-based Linux distributions.

Why Package Managers Matter

Without a package manager, you would need to:

  • Manually download software
  • Resolve all dependencies yourself
  • Track which files belong to which software
  • Manually update each program
  • Handle conflicts between different versions

With DNF, you can:

  • Install software with one command
  • Automatically resolve dependencies
  • Update all software at once
  • Cleanly remove software and its dependencies
  • Verify package integrity

DNF vs YUM

If you've used older RHEL/CentOS systems, you might know YUM. DNF is the modern replacement:

FeatureYUM (Old)DNF (New)
Dependency resolutionGoodBetter (more accurate)
PerformanceSlowerFaster
Memory usageHigherLower
APIPython 2Python 3

Good News: DNF commands are compatible with YUM. If you know YUM, you already know DNF!

🔍 Checking Installed Packages

Let's start by exploring what software is already installed on your system.

Listing Installed Packages

dnf list installed podman

What this command does:

  • dnf - The package manager command
  • list - Show packages
  • installed - Filter to only show installed packages
  • podman - The specific package we're checking

Output:

Installed Packages
podman.x86_64        6:5.6.0-2.el9        @appstream

Understanding the output:

ComponentValueMeaning
Package namepodmanName of the software
Architecturex86_6464-bit Intel/AMD processor
Epoch6:Version priority (higher = newer)
Version5.6.0Software version number
Release2.el9Package build number for EL9
Repository@appstreamInstalled from appstream repo

The @ symbol in @appstream means:

  • Package is currently installed on the system
  • It was originally downloaded from the "appstream" repository

📋 Getting Detailed Package Information

The dnf info command provides comprehensive details about a package.

Viewing Package Information

dnf info podman

What this command does:

  • dnf - Package manager
  • info - Show detailed information
  • podman - The package to query

First, DNF synchronizes with repositories:

Node.js Packages for Linux RPM based distros - x86_64         2.7 MB/s | 1.0 MB     00:00
N|Solid Packages for Linux RPM based distros - x86_64         2.9 MB/s | 840 kB     00:00
CentOS Stream 9 - BaseOS                                      2.0 MB/s | 8.8 MB     00:04
CentOS Stream 9 - AppStream                                   2.8 MB/s |  25 MB     00:09
Extra Packages for Enterprise Linux 9 - x86_64                2.9 MB/s |  20 MB     00:06

Understanding repository sync:

RepositoryPurposeSize
CentOS Stream 9 - BaseOSCore system packages8.8 MB metadata
CentOS Stream 9 - AppStreamApplication packages25 MB metadata
EPEL 9Extra community packages20 MB metadata
Docker CE StableDocker container platform55 kB metadata

Why synchronization happens:

  1. DNF checks for updated package lists
  2. Downloads metadata (information about available packages)
  3. Shows download speed and size
  4. Ensures you see the latest package information

Then comes the package details:

Installed Packages
Name         : podman
Epoch        : 6
Version      : 5.6.0
Release      : 2.el9
Architecture : x86_64
Size         : 55 M
Source       : podman-5.6.0-2.el9.src.rpm
Repository   : @System
From repo    : appstream
Summary      : Manage Pods, Containers and Container Images
URL          : https://podman.io/
License      : Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
Description  : podman (Pod Manager) is a fully featured container engine that is a simple
             : daemonless tool.  podman provides a Docker-CLI comparable command line that
             : eases the transition from other container engines and allows the management of
             : pods, containers and images.  Simply put: alias docker=podman.
             : Most podman commands can be run as a regular user, without requiring
             : additional privileges.
             :
             : podman uses Buildah(1) internally to create container images.
             : Both tools share image (not container) storage, hence each can use or
             : manipulate images (but not containers) created by the other.

Understanding each field:

Name: podman - The package name you use with DNF commands

Epoch: 6 - Version priority number

  • Used when version numbers alone can't determine which is newer
  • Higher epoch = more recent, regardless of version number
  • Rarely changes (usually stays at 0 or 1)

Version: 5.6.0 - Upstream software version

  • Software developer's version number
  • Format: major.minor.patch

Release: 2.el9 - Distribution-specific build

  • 2 = Second build of this version
  • el9 = Enterprise Linux 9

Architecture: x86_64 - CPU architecture

  • x86_64 = 64-bit Intel/AMD
  • aarch64 = 64-bit ARM
  • noarch = Works on any architecture

Size: 55 M - Installed size on disk

  • Amount of disk space used after installation
  • This is INSTALLED size, not download size

Source: podman-5.6.0-2.el9.src.rpm - Source package name

  • Original source code package
  • Useful for building custom versions

Repository: @System - Currently installed

  • @System means it's on your system now
  • Shows which repository it would come from if reinstalling

From repo: appstream - Origin repository

  • Where it was originally downloaded from

Summary: One-line description of what the package does

URL: Official project website

License: Software licenses

  • Important for understanding usage rights
  • Multiple licenses may apply to different components

Description: Detailed explanation

  • What the software does
  • How it works
  • Special features or requirements
💡

💡 Size Note: The download size is usually smaller than the installed size due to compression. DNF shows you the installed size to help you plan disk space.

📜 Viewing Package Changelogs

Changelogs show the history of updates and fixes for a package.

Checking Package Changelog

dnf changelog podman

What this command does:

  • dnf - Package manager
  • changelog - Show change history
  • podman - Package to query

First, repository sync (similar to dnf info):

Node.js Packages for Linux RPM based distros - x86_64         873 kB/s | 1.0 MB     00:01
N|Solid Packages for Linux RPM based distros - x86_64         1.4 MB/s | 842 kB     00:00
CentOS Stream 9 - BaseOS                                      1.9 MB/s |  11 MB     00:06
...

Then the changelog entries:

Listing all changelogs
Changelogs for podman-6:5.6.0-2.el9.x86_64
* Fri Aug 22 12:00:00 AM 2025 Jindrich Novy <jnovy@redhat.com> - 5:5.6.0-2
- update to the latest content of https://github.com/containers/podman/tree/v5.6-rhel
  (https://github.com/containers/podman/commit/56f1962)
- fixes "Work on RHEL 9.7 packaging"
- Related: RHEL-80816

* Wed Aug 20 12:00:00 AM 2025 Jindrich Novy <jnovy@redhat.com> - 5:5.6.1-0.1
- update to the latest content of https://github.com/containers/podman/tree/v5.6
  (https://github.com/containers/podman/commit/d46b857)
- fixes "Work on RHEL 9.7 packaging"
- Related: RHEL-80816

* Mon Aug 18 12:00:00 AM 2025 Jindrich Novy <jnovy@redhat.com> - 5:5.6.0-1
- update to https://github.com/containers/podman/releases/tag/v5.6.0
- Related: RHEL-80816

Understanding changelog format:

Each entry contains:

Date and maintainer:

* Fri Aug 22 12:00:00 AM 2025 Jindrich Novy <jnovy@redhat.com> - 5:5.6.0-2
  • Date: When the package was built
  • Name and email: Package maintainer
  • Version: 5:5.6.0-2 (epoch:version-release)

Change description:

  • What was updated
  • Why the update was made
  • Links to relevant bug reports or commits

Bug tracking:

  • Related: RHEL-80816 - Reference to bug tracking system
  • Resolves: RHEL-12345 - Indicates this update fixes a bug
  • Fixes: - Lists specific issues fixed

Why Changelogs Matter

Use CaseWhat to Look For
Security updatesEntries mentioning CVE numbers or security fixes
Bug fixes"Resolves" or "Fixes" entries
New featuresVersion number changes and feature descriptions
Breaking changesNotices about compatibility or deprecation

🎯 Best Practices

✅ Package Management

  1. Always check if a package is installed before installing

    dnf list installed package_name
    
  2. Read package information before installing

    dnf info package_name
    
    • Check the size to ensure you have disk space
    • Read the description to confirm it's what you need
    • Note the dependencies
  3. Review changelogs for important updates

    dnf changelog package_name
    
    • Look for security fixes
    • Check for breaking changes
    • Understand what's new
  4. Keep your system updated

    sudo dnf check-update    # See available updates
    sudo dnf update          # Apply all updates
    
  5. Clean up after installations

    sudo dnf clean all       # Remove cached data
    sudo dnf autoremove      # Remove unused dependencies
    

✅ Repository Management

  1. Understand your enabled repositories

    dnf repolist             # List enabled repos
    dnf repolist all         # List all repos (enabled and disabled)
    
  2. Enable/disable repositories as needed

    sudo dnf config-manager --enable repo_name
    sudo dnf config-manager --disable repo_name
    
  3. Be cautious with third-party repositories

    • Only add trusted sources
    • Understand what packages they provide
    • Check repository priorities

✅ Safety Practices

  1. Don't blindly install packages

    • Read descriptions
    • Check reviews or documentation
    • Verify the source repository
  2. Test updates in non-production first

    • Use test systems when possible
    • Read changelogs for major updates
    • Have a rollback plan
  3. Keep documentation

    • Note why you installed packages
    • Document custom repositories
    • Track configuration changes

📝 DNF Command Cheat Sheet

Querying Packages

# List installed packages
dnf list installed                    # All installed packages
dnf list installed package_name       # Check specific package
dnf list available                    # Available packages
dnf list updates                      # Available updates

# Get package information
dnf info package_name                 # Detailed package info
dnf changelog package_name            # Package change history
dnf provides /path/to/file           # Find which package provides a file

# Search for packages
dnf search keyword                    # Search package names and descriptions
dnf search all keyword                # Search everything including file lists

Installing and Removing Packages

# Install packages
sudo dnf install package_name         # Install a package
sudo dnf install package1 package2    # Install multiple packages
sudo dnf reinstall package_name       # Reinstall a package
sudo dnf downgrade package_name       # Downgrade to older version

# Remove packages
sudo dnf remove package_name          # Remove a package
sudo dnf autoremove                   # Remove unused dependencies
sudo dnf autoremove package_name      # Remove package and unused dependencies

Updating Packages

# Check for updates
dnf check-update                      # List available updates
dnf list updates                      # Alternative way to check

# Apply updates
sudo dnf update                       # Update all packages
sudo dnf update package_name          # Update specific package
sudo dnf upgrade                      # Same as update (kept for compatibility)

# Update with automatic yes
sudo dnf update -y                    # Skip confirmation prompts

Repository Management

# List repositories
dnf repolist                          # List enabled repositories
dnf repolist all                      # List all repositories
dnf repolist disabled                 # List disabled repositories

# Repository information
dnf repoinfo repository_name          # Get repo details

# Enable/disable repositories
sudo dnf config-manager --enable repo_name
sudo dnf config-manager --disable repo_name

# Add repository
sudo dnf config-manager --add-repo URL

Group Operations

# Work with package groups
dnf group list                        # List available groups
dnf group info "Group Name"           # Get group details
sudo dnf group install "Group Name"   # Install a group
sudo dnf group remove "Group Name"    # Remove a group

Maintenance and Cleanup

# Clean cached data
sudo dnf clean all                    # Clean all cache
sudo dnf clean packages               # Clean package cache
sudo dnf clean metadata               # Clean metadata cache

# Check for problems
dnf check                             # Check for dependency problems
dnf repoquery --duplicates            # Find duplicate packages

History and Transactions

# View transaction history
dnf history                           # List all transactions
dnf history info ID                   # Details of specific transaction
sudo dnf history undo ID              # Undo a transaction
sudo dnf history redo ID              # Redo a transaction
sudo dnf history rollback ID          # Rollback to specific point

Advanced Queries

# Dependency information
dnf deplist package_name              # List dependencies
dnf repoquery --requires package_name # What package needs
dnf repoquery --whatrequires package_name  # What needs this package

# Find package owner
dnf provides */bin/command            # Which package provides a command
rpm -qf /path/to/file                # Which installed package owns a file

# List package files
dnf repoquery -l package_name         # List files in package
rpm -ql package_name                  # List files in installed package

Performance Options

# Speed up operations
sudo dnf makecache                    # Pre-download metadata
sudo dnf makecache --refresh          # Force metadata refresh

# Limit download speed (in KB/s)
sudo dnf --setopt=throttle=100 update

# Download only (no install)
sudo dnf download package_name
sudo dnf download --resolve package_name  # Include dependencies

Useful Combinations

# Search and install in one go
sudo dnf search httpd && sudo dnf install httpd

# Update and clean up
sudo dnf update -y && sudo dnf autoremove -y && sudo dnf clean all

# Check package before installing
dnf info package_name && sudo dnf install package_name

# Find and remove packages matching pattern
dnf list installed | grep pattern
sudo dnf remove $(dnf list installed | grep pattern | awk '{print $1}')

🚀 What's Next?

📚 Continue Learning

  • Creating Custom RPM Packages - Build your own packages
  • Repository Management - Set up local repositories
  • Module Streams - Work with AppStream modules
  • Package Signing and Security - Verify package integrity

🛠️ Practice Projects

  • Create a script to check for security updates
  • Set up automatic update schedules with dnf-automatic
  • Build a custom repository for your organization
  • Monitor package changes with dnf history

🎉 Congratulations! You now understand how to use DNF to manage packages on your RHEL/CentOS/Fedora system. Package management is a fundamental skill that will serve you throughout your Linux journey!

💬 Discussion

I'd love to hear about your experience:

  • What packages do you install most frequently?
  • Have you encountered any dependency issues? How did you solve them?
  • Do you use any third-party repositories? Which ones?
  • What other package management topics would you like to learn about?

Connect with me:

  • 🐙 GitHub - More Linux tutorials and scripts
  • 📧 Contact - Questions about Linux administration
Owais

Written by Owais

I'm an AIOps Engineer with a passion for AI, Operating Systems, Cloud, and Security—sharing insights that matter in today's tech world.

I completed the UK's Eduqual Level 6 Diploma in AIOps from Al Nafi International College, a globally recognized program that's changing careers worldwide. This diploma is:

  • ✅ Available online in 17+ languages
  • ✅ Includes free student visa guidance for Master's programs in Computer Science fields across the UK, USA, Canada, and more
  • ✅ Comes with job placement support and a 90-day success plan once you land a role
  • ✅ Offers a 1-year internship experience letter while you study—all with no hidden costs

It's not just a diploma—it's a career accelerator.

👉 Start your journey today with a 7-day free trial

Related Articles

Continue exploring with these handpicked articles that complement what you just read

More Reading

One more article you might find interesting