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:
Feature | YUM (Old) | DNF (New) |
---|---|---|
Dependency resolution | Good | Better (more accurate) |
Performance | Slower | Faster |
Memory usage | Higher | Lower |
API | Python 2 | Python 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 commandlist
- Show packagesinstalled
- Filter to only show installed packagespodman
- The specific package we're checking
Output:
Installed Packages
podman.x86_64 6:5.6.0-2.el9 @appstream
Understanding the output:
Component | Value | Meaning |
---|---|---|
Package name | podman | Name of the software |
Architecture | x86_64 | 64-bit Intel/AMD processor |
Epoch | 6: | Version priority (higher = newer) |
Version | 5.6.0 | Software version number |
Release | 2.el9 | Package build number for EL9 |
Repository | @appstream | Installed 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 managerinfo
- Show detailed informationpodman
- 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:
Repository | Purpose | Size |
---|---|---|
CentOS Stream 9 - BaseOS | Core system packages | 8.8 MB metadata |
CentOS Stream 9 - AppStream | Application packages | 25 MB metadata |
EPEL 9 | Extra community packages | 20 MB metadata |
Docker CE Stable | Docker container platform | 55 kB metadata |
Why synchronization happens:
- DNF checks for updated package lists
- Downloads metadata (information about available packages)
- Shows download speed and size
- 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 versionel9
= Enterprise Linux 9
Architecture: x86_64
- CPU architecture
x86_64
= 64-bit Intel/AMDaarch64
= 64-bit ARMnoarch
= 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 managerchangelog
- Show change historypodman
- 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 systemResolves: RHEL-12345
- Indicates this update fixes a bugFixes:
- Lists specific issues fixed
Why Changelogs Matter
Use Case | What to Look For |
---|---|
Security updates | Entries mentioning CVE numbers or security fixes |
Bug fixes | "Resolves" or "Fixes" entries |
New features | Version number changes and feature descriptions |
Breaking changes | Notices about compatibility or deprecation |
🎯 Best Practices
✅ Package Management
-
Always check if a package is installed before installing
dnf list installed package_name
-
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
-
Review changelogs for important updates
dnf changelog package_name
- Look for security fixes
- Check for breaking changes
- Understand what's new
-
Keep your system updated
sudo dnf check-update # See available updates sudo dnf update # Apply all updates
-
Clean up after installations
sudo dnf clean all # Remove cached data sudo dnf autoremove # Remove unused dependencies
✅ Repository Management
-
Understand your enabled repositories
dnf repolist # List enabled repos dnf repolist all # List all repos (enabled and disabled)
-
Enable/disable repositories as needed
sudo dnf config-manager --enable repo_name sudo dnf config-manager --disable repo_name
-
Be cautious with third-party repositories
- Only add trusted sources
- Understand what packages they provide
- Check repository priorities
✅ Safety Practices
-
Don't blindly install packages
- Read descriptions
- Check reviews or documentation
- Verify the source repository
-
Test updates in non-production first
- Use test systems when possible
- Read changelogs for major updates
- Have a rollback plan
-
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: