jasmine
+
+
++
+
+
f#
+
+
istio
pinecone
aws
+
graphdb
โІ
+
debian
+
+
+
svelte
axum
+
pytest
+
+
nuxt
+
+
ionic
+
+
+
bundler
+
โˆ‰
+
+
alpine
graphdb
+
+
+
ada
deno
weaviate
+
mongo
haiku
>=
scipy
!
+
rubymine
+
nest
spring
+
+
+
^
&&
rider
+
pip
+
packer
+
===
junit
rocket
express
grpc
+
kotlin
sse
+
vite
wasm
+
+
+
r
+
*
prometheus
+
+
|>
โˆˆ
Back to Blog
๐Ÿ“ฆ AlmaLinux Package Management: Complete DNF & YUM Guide
AlmaLinux Package Management DNF

๐Ÿ“ฆ AlmaLinux Package Management: Complete DNF & YUM Guide

Published Sep 17, 2025

Master package management on AlmaLinux! Learn DNF commands, repositories, updates, and software installation. Complete beginner-friendly guide with real examples and best practices.

30 min read
0 views
Table of Contents

๐Ÿ“ฆ AlmaLinux Package Management: Complete DNF & YUM Guide

Welcome to the wonderful world of package management on AlmaLinux! ๐ŸŽ‰ Think of package management as your personal software store where you can install, update, and remove programs with just a few simple commands. Whether you want to install a web server, development tools, or games, the package manager makes it incredibly easy! ๐Ÿ›๏ธ

Package management might seem intimidating at first, but itโ€™s actually one of the most user-friendly aspects of Linux! ๐Ÿ’ช From installing your first package to managing complex dependencies and repositories, weโ€™ll learn everything step by step. Get ready to become a software installation wizard and make your AlmaLinux system do exactly what you want! โœจ

๐Ÿค” Why is Package Management Important?

Package management is the heart of Linux system administration! Hereโ€™s why you should master it:

  • ๐ŸŽฏ Easy Installation: Install software with a single command
  • ๐Ÿ”„ Automatic Updates: Keep your system secure with automatic updates
  • ๐Ÿ›ก๏ธ Dependency Resolution: Automatically handle software dependencies
  • ๐Ÿงน Clean Removal: Remove software completely without leftover files
  • ๐Ÿ“Š Security Updates: Get critical security patches quickly
  • ๐ŸŒŸ Software Discovery: Find new software easily through repositories
  • โšก Efficient Management: Handle thousands of packages effortlessly
  • ๐Ÿ” Package Information: Get detailed information about any software

๐ŸŽฏ What You Need

Before we start managing packages, make sure you have:

โœ… AlmaLinux 8 or 9 installed and running โœ… Root or sudo access for installing and removing packages โœ… Internet connection for downloading packages โœ… Basic terminal knowledge (cd, ls, cat commands) โœ… Understanding of user permissions (sudo usage) โœ… Some idea of software you want to install (optional but helpful) โœ… Patience for larger downloads and installations

๐Ÿ“ Understanding DNF Package Manager

Letโ€™s start by understanding AlmaLinuxโ€™s package manager! ๐ŸŽ“

DNF vs YUM

# Check DNF version
dnf --version
# Output: Shows DNF version and Python version

# Check if YUM is available (it's a symlink to DNF)
which yum
# Output: /usr/bin/yum (points to DNF)

# Both commands work the same way
dnf list installed | head -5
yum list installed | head -5
# Output: Both show the same installed packages

# Check package manager configuration
cat /etc/dnf/dnf.conf
# Output: Shows DNF configuration settings

Basic Package Information

# Search for a package
dnf search nginx
# Output: Shows packages matching "nginx"

# Get detailed package information
dnf info nginx
# Output: Shows description, version, size, etc.

# List all available packages
dnf list available | head -10
# Output: Shows first 10 available packages

# List installed packages
dnf list installed | head -10
# Output: Shows first 10 installed packages

๐Ÿ”ง Installing Packages

Basic Package Installation

# Install a single package
sudo dnf install nginx
# Output: Shows package details and asks for confirmation

# Install multiple packages at once
sudo dnf install git vim wget curl
# Output: Installs all specified packages

# Install package without confirmation prompt
sudo dnf install -y htop
# Output: Installs directly without asking

# Install package from specific repository
sudo dnf install epel-release
# Output: Installs EPEL repository package

Installing Package Groups

# List available package groups
dnf group list
# Output: Shows available package groups

# Get information about a group
dnf group info "Development Tools"
# Output: Shows packages in the Development Tools group

# Install a package group
sudo dnf group install "Development Tools"
# Output: Installs all development tools

# Install minimal group (only required packages)
sudo dnf group install --setopt=group_package_types=mandatory "Web Server"
# Output: Installs only essential web server packages

๐ŸŒŸ Managing Repositories

Understanding Repositories

# List enabled repositories
dnf repolist enabled
# Output: Shows all enabled package repositories

# List all repositories (enabled and disabled)
dnf repolist all
# Output: Shows all configured repositories

# Get repository information
dnf repoinfo base
# Output: Shows details about the base repository

# Search for packages in specific repository
dnf --enablerepo=epel search nodejs
# Output: Searches for nodejs in EPEL repository

Adding New Repositories

# Add EPEL repository (Extra Packages for Enterprise Linux)
sudo dnf install epel-release -y
# Output: Installs and configures EPEL repository

# Add RPM Fusion repository
sudo dnf install --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
# Output: Installs RPM Fusion free repository

# Add a custom repository
sudo nano /etc/yum.repos.d/custom.repo
# Add this content:
[custom-repo]
name=Custom Repository
baseurl=https://repo.example.com/almalinux/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://repo.example.com/RPM-GPG-KEY

# Update repository metadata
sudo dnf makecache
# Output: Downloads repository metadata

โœ… Updating and Upgrading

System Updates

# Check for available updates
dnf check-update
# Output: Shows packages that can be updated

# Update all packages
sudo dnf update
# Output: Updates all installed packages

# Update specific package
sudo dnf update nginx
# Output: Updates only nginx package

# Update and auto-answer yes
sudo dnf update -y
# Output: Updates without confirmation prompts

Security Updates

# Install only security updates
sudo dnf update --security
# Output: Installs only security-related updates

# List available security updates
dnf updateinfo list security
# Output: Shows available security updates

# Get information about security updates
dnf updateinfo info
# Output: Shows detailed security update information

# Update system to latest release
sudo dnf system-upgrade download --releasever=9
# Output: Downloads packages for system upgrade

๐Ÿ”ง Removing and Cleaning

Package Removal

# Remove a package
sudo dnf remove nginx
# Output: Removes nginx package

# Remove package and its dependencies (if not needed elsewhere)
sudo dnf autoremove
# Output: Removes orphaned packages

# Remove package group
sudo dnf group remove "Development Tools"
# Output: Removes entire package group

# Simulate removal (see what would be removed)
dnf remove --assumeno nginx
# Output: Shows what would be removed without actually doing it

System Cleanup

# Clean package cache
sudo dnf clean packages
# Output: Removes downloaded package files

# Clean all cache
sudo dnf clean all
# Output: Removes all cached data

# Clean expired repository metadata
sudo dnf clean expire-cache
# Output: Removes old repository information

# List largest installed packages
dnf repoquery --installed --queryformat='%{size} %{name}' | sort -rn | head -10
# Output: Shows 10 largest packages by size

๐ŸŽฎ Quick Examples

Example 1: Setting Up Web Development Environment

# Install web development tools
sudo dnf groupinstall "Development Tools" -y
# Output: Installs compilers and development utilities

# Install Node.js and npm
sudo dnf install nodejs npm -y
# Output: Installs Node.js runtime and package manager

# Install Apache web server
sudo dnf install httpd -y
# Output: Installs Apache HTTP server

# Install MySQL/MariaDB
sudo dnf install mariadb-server mariadb -y
# Output: Installs MariaDB database server

# Install PHP
sudo dnf install php php-mysql php-json -y
# Output: Installs PHP and essential modules

# Verify installations
node --version && npm --version
httpd -version
mysql --version
php --version
# Output: Shows version numbers of installed software

Example 2: Media Server Setup

# Add RPM Fusion repository for media codecs
sudo dnf install epel-release -y
sudo dnf config-manager --enable powertools
sudo dnf install --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm

# Install media server software
sudo dnf install plex-media-server -y
# Output: Installs Plex Media Server

# Install media tools
sudo dnf install ffmpeg vlc -y
# Output: Installs video processing tools

# Install file sharing tools
sudo dnf install samba samba-client -y
# Output: Installs Samba for Windows file sharing

# Check what was installed
dnf list installed | grep -E "(plex|ffmpeg|vlc|samba)"
# Output: Shows installed media-related packages

Example 3: Security and Monitoring Tools

# Install security scanning tools
sudo dnf install nmap wireshark-cli tcpdump -y
# Output: Installs network security tools

# Install system monitoring tools
sudo dnf install htop iotop nethogs -y
# Output: Installs system monitoring utilities

# Install firewall management
sudo dnf install firewalld -y
# Output: Installs advanced firewall

# Install intrusion detection
sudo dnf install fail2ban -y
# Output: Installs intrusion prevention system

# Install log analysis tools
sudo dnf install logwatch logrotate -y
# Output: Installs log management tools

# Verify security tools
nmap --version
htop --version
firewall-cmd --version
# Output: Shows versions of security tools

๐Ÿšจ Fix Common Problems

Problem 1: Package Installation Fails

Symptoms: Error messages during package installation

Solution:

# Update repository metadata
sudo dnf makecache
# Output: Refreshes repository information

# Check for conflicting packages
dnf list conflicts
# Output: Shows conflicting packages if any

# Clean DNF cache and try again
sudo dnf clean all
sudo dnf makecache
sudo dnf install package-name
# Output: Fresh cache should resolve issues

# Check available disk space
df -h /var/cache/dnf
# Output: Shows available space for package cache

# Force refresh of expired repositories
sudo dnf clean expire-cache
sudo dnf check-update
# Output: Forces repository refresh

Problem 2: Dependency Resolution Errors

Symptoms: Cannot install package due to dependency conflicts

Solution:

# Check what packages provide missing dependency
dnf provides missing-file-or-library
# Output: Shows packages that provide the missing item

# Try installing with --best flag
sudo dnf install --best package-name
# Output: Tries to install best available version

# Install specific version to resolve conflicts
sudo dnf install package-name-1.2.3
# Output: Installs specific version

# Use --allowerasing to resolve conflicts
sudo dnf install --allowerasing package-name
# Output: Allows removal of conflicting packages

# Check for broken dependencies
dnf repoquery --unsatisfied
# Output: Shows packages with unsatisfied dependencies

Problem 3: Repository Not Available

Symptoms: Cannot connect to repository or repository not found

Solution:

# Check repository configuration
dnf repolist enabled
# Output: Shows enabled repositories

# Test repository connectivity
dnf repolist --verbose
# Output: Shows detailed repository information

# Disable problematic repository temporarily
sudo dnf config-manager --disable repository-name
# Output: Disables specific repository

# Update repository URLs if changed
sudo nano /etc/yum.repos.d/repository-name.repo
# Edit baseurl or mirrorlist as needed

# Import missing GPG keys
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
# Output: Imports signing keys for verification

๐Ÿ“‹ Simple Commands Summary

CommandPurposeExample
dnf installInstall packagesdnf install nginx
dnf removeRemove packagesdnf remove nginx
dnf updateUpdate packagesdnf update
dnf searchSearch packagesdnf search web server
dnf infoPackage informationdnf info nginx
dnf list installedList installed packagesdnf list installed
dnf repolistList repositoriesdnf repolist enabled
dnf clean allClean cachednf clean all

๐Ÿ’ก Tips for Success

Here are proven strategies to master package management! ๐ŸŒŸ

Best Practices

  • ๐Ÿ“‹ Regular Updates: Keep your system updated with security patches
  • ๐Ÿ” Research First: Read package descriptions before installing
  • ๐Ÿ’พ Backup Before Major Changes: Create system snapshots before big updates
  • ๐ŸŽฏ Use Groups: Install related packages together using groups
  • ๐Ÿงน Clean Regularly: Remove unused packages and clean cache periodically
  • ๐Ÿ›ก๏ธ Verify Sources: Only install packages from trusted repositories
  • ๐Ÿ“Š Monitor Space: Keep an eye on disk usage, especially in /var
  • ๐Ÿ”„ Test Updates: Test major updates in non-production environments first

Optimization Tips

  • Use package groups for bulk installations instead of individual packages ๐Ÿ“ฆ
  • Enable fastest mirror selection for better download speeds โšก
  • Set up automatic security updates for critical systems ๐Ÿ›ก๏ธ
  • Use local mirrors when available to reduce bandwidth usage ๐ŸŒ
  • Clean package cache regularly to free up disk space ๐Ÿงน
  • Document installed packages for system recreation ๐Ÿ“
  • Use deltarpm for smaller update downloads ๐Ÿ“Š
  • Monitor package dependency changes during updates ๐Ÿ”

๐Ÿ† What You Learned

Congratulations! Youโ€™ve mastered package management on AlmaLinux! ๐ŸŽ‰ Hereโ€™s what you can now do:

โœ… Install Software: Install individual packages and package groups โœ… Manage Repositories: Add, configure, and manage software repositories โœ… Update Systems: Keep your system secure with regular updates โœ… Remove Software: Clean up unwanted packages and dependencies โœ… Search Software: Find packages and get detailed information โœ… Troubleshoot Issues: Resolve common package management problems โœ… Optimize Performance: Use efficient package management practices โœ… Handle Dependencies: Understand and resolve dependency conflicts

๐ŸŽฏ Why This Matters

Mastering package management is fundamental to Linux administration! ๐Ÿš€ With these skills, you can:

  • Build Any Environment: Quickly set up development, web, or database servers ๐Ÿ—๏ธ
  • Maintain Security: Keep systems protected with timely security updates ๐Ÿ›ก๏ธ
  • Save Time: Install complex software stacks with simple commands โฐ
  • Ensure Consistency: Reproduce environments reliably across systems ๐ŸŽฏ
  • Manage Scale: Handle package management for multiple servers efficiently ๐Ÿ“ˆ
  • Troubleshoot Effectively: Resolve software installation and update issues ๐Ÿ”ง

Package management is your gateway to the vast ecosystem of Linux software! Whether youโ€™re setting up a simple web server or a complex enterprise application stack, these skills will serve you throughout your Linux journey. Remember, with great power comes great responsibility - always test updates and keep backups! โญ

Excellent work on mastering AlmaLinux package management! You now have the skills to turn your system into anything you need it to be! ๐Ÿ™Œ