azure
echo
+
+
+
+
+
spacy
+
ada
axum
scipy
+
+
+
+
c
+
+
android
jasmine
parcel
rocket
+
+
+
+
delphi
+
rocket
qdrant
||
bundler
+
+
+
alpine
_
โˆ‚
xgboost
couchdb
+
+
+
py
=>
+
+
pip
+
+
azure
@
influxdb
+
express
+
gh
quarkus
+
+
htmx
jax
+
rest
+
โˆซ
+
+
+
+
+
+
+
+
java
<-
clion
pip
+
nim
xgboost
+
+
jasmine
+
&
+
+
http
Back to Blog
๐Ÿ”„ How to Update AlmaLinux: Complete Package Update Guide
almalinux update dnf

๐Ÿ”„ How to Update AlmaLinux: Complete Package Update Guide

Published Sep 16, 2025

Master AlmaLinux updates! Complete guide for keeping your system secure with DNF package manager. Learn automatic updates, security patches, and troubleshooting. Perfect for beginners.

14 min read
0 views
Table of Contents

๐Ÿ”„ How to Update AlmaLinux: Complete Package Update Guide

Want to keep your AlmaLinux system secure and running smoothly? ๐Ÿš€ Regular updates are essential for security, performance, and new features! This beginner-friendly guide shows you everything about updating AlmaLinux - from simple one-command updates to advanced patch management. Letโ€™s keep your system bulletproof! โšก

๐Ÿค” Why Update AlmaLinux Regularly?

Updates are your systemโ€™s superpower! ๐ŸŒŸ Hereโ€™s why theyโ€™re crucial:

  • ๐Ÿ›ก๏ธ Security Patches: Fix vulnerabilities before hackers exploit them
  • ๐Ÿš€ Performance Improvements: Faster speeds and better efficiency
  • ๐Ÿ› Bug Fixes: Solve annoying problems and crashes
  • โœจ New Features: Get latest capabilities and tools
  • ๐Ÿ’ผ Compliance: Meet enterprise security requirements
  • ๐Ÿ”ง Stability: Improved reliability and fewer issues
  • ๐ŸŒ Compatibility: Better hardware and software support
  • ๐Ÿ“ฑ Modern Support: Keep up with latest technologies

Security updates can prevent 99% of common attacks! ๐Ÿ†

๐ŸŽฏ What You Need

Letโ€™s prepare for update mastery! โœ…

  • โœ… AlmaLinux system (any version)
  • โœ… Internet connection for downloads
  • โœ… Admin/sudo access to system
  • โœ… 15 minutes for basic updates
  • โœ… Basic terminal knowledge helpful
  • โœ… Backup of important data (recommended)
  • โœ… Understanding that updates need reboots sometimes
  • โœ… Patience for large updates! ๐ŸŽ‰

Letโ€™s keep your system current and secure! ๐Ÿ›ก๏ธ

๐Ÿ“ Step 1: Check Current System Status

First, letโ€™s see what weโ€™re working with! ๐Ÿ”

Check System Information:

# See current AlmaLinux version
cat /etc/redhat-release

# Check system details
hostnamectl

# See kernel version
uname -r

# Check last update time
stat /var/log/dnf.log

# Example output:
AlmaLinux release 9.3 (Shamrock)
Kernel: 5.14.0-362.8.1.el9_3.x86_64

Check Available Updates:

# Check for available updates (doesn't install)
dnf check-update

# Count available updates
dnf check-update | wc -l

# Check security updates only
dnf --security check-update

# See what's installed currently
dnf list installed | head -10

Check Repository Status:

# List configured repositories
dnf repolist

# Check repository status
dnf repolist all

# Refresh repository metadata
dnf makecache

# Example output:
repo id              repo name
appstream            AlmaLinux 9 - AppStream
baseos              AlmaLinux 9 - BaseOS
extras              AlmaLinux 9 - Extras

Perfect! ๐ŸŽ‰ You know your system status!

๐Ÿ”ง Step 2: Basic System Updates

Learn the essential update commands! โšก

Simple System Update:

# Update everything (most common command)
sudo dnf update

# Same as above, but with confirmation
sudo dnf update -y

# Update and also upgrade to newer versions
sudo dnf upgrade

# Update specific package
sudo dnf update firefox

# Update multiple specific packages
sudo dnf update firefox vim git

Security Updates Only:

# Install only security updates
sudo dnf --security update

# Check what security updates are available
sudo dnf --security check-update

# Install all security updates automatically
sudo dnf update --security -y

# See security advisories
dnf updateinfo list security

Update Process Explained:

# What happens during 'dnf update':
1. Downloads package metadata from repositories
2. Checks for newer versions of installed packages
3. Calculates dependencies
4. Shows what will be updated
5. Asks for confirmation (unless -y used)
6. Downloads packages
7. Installs updates
8. Cleans up temporary files

# Typical output:
Dependencies resolved.
Package                Version              Repository    Size
Updating:
firefox               115.0.2-1.el9        appstream     95 M
vim-enhanced          9.0.1160-1.el9       appstream     1.9 M

Transaction Summary
Upgrade  2 Packages

Total download size: 97 M
Is this ok [y/N]: y

Amazing! ๐ŸŒŸ Basic updates are mastered!

๐ŸŒŸ Step 3: Advanced Update Management

Power user update techniques! ๐Ÿš€

Update with Exclude Options:

# Update everything except specific package
sudo dnf update --exclude=kernel*

# Exclude multiple packages
sudo dnf update --exclude=kernel*,firefox

# Skip broken packages
sudo dnf update --skip-broken

# Download only, don't install
sudo dnf update --downloadonly

Repository-Specific Updates:

# Update only from specific repository
sudo dnf --enablerepo=epel update

# Disable repository during update
sudo dnf --disablerepo=extras update

# Update from all repositories including disabled ones
sudo dnf --enablerepo='*' update

Kernel Updates:

# Check current kernel
uname -r

# List available kernels
dnf list kernel

# Update kernel specifically
sudo dnf update kernel

# Install new kernel (keeps old ones)
sudo dnf install kernel

# Remove old kernels (keep latest 3)
sudo dnf remove $(dnf repoquery --installonly --latest-limit=-3 -q)

Package Groups:

# List package groups
dnf group list

# Update entire group
sudo dnf group update "Development Tools"

# Install missing packages in group
sudo dnf group install "System Tools"

Excellent! โšก Advanced update skills unlocked!

โœ… Step 4: Automatic Updates Setup

Set up hands-free updates! ๐Ÿค–

Install DNF Automatic:

# Install automatic update service
sudo dnf install dnf-automatic

# Check configuration file
cat /etc/dnf/automatic.conf

# Example configuration:
[commands]
upgrade_type = default        # or 'security' for security only
random_sleep = 3600          # Random delay in seconds
download_updates = yes       # Download updates
apply_updates = yes          # Apply updates automatically

Configure Automatic Updates:

# Edit configuration
sudo nano /etc/dnf/automatic.conf

# Recommended settings for desktop:
[commands]
upgrade_type = security      # Only security updates
random_sleep = 1800         # 30 minute random delay
download_updates = yes      # Download automatically
apply_updates = yes         # Install automatically
reboot = never             # Never auto-reboot

[emitters]
emit_via = email           # Send email notifications
email_from = [email protected]
email_to = [email protected]

# Conservative settings for servers:
apply_updates = no         # Download but don't install
reboot = never            # Never reboot automatically

Enable Automatic Updates:

# Enable the timer service
sudo systemctl enable --now dnf-automatic.timer

# Check status
sudo systemctl status dnf-automatic.timer

# View timer schedule
systemctl list-timers | grep dnf

# Check logs
journalctl -u dnf-automatic.service

# Manual run for testing
sudo systemctl start dnf-automatic.service

Perfect! ๐Ÿ† Automatic updates are configured!

๐Ÿ”ง Step 5: Update Troubleshooting

Fix common update issues! ๐Ÿ› ๏ธ

Common Update Problems:

# Problem: Dependency conflicts
# Solution: Try with skip-broken
sudo dnf update --skip-broken

# Problem: Repository errors
# Solution: Clear cache and retry
sudo dnf clean all
sudo dnf makecache
sudo dnf update

# Problem: Download failures
# Solution: Try different mirror
sudo dnf update --setopt=fastestmirror=true

# Problem: Insufficient space
# Solution: Clean up system
sudo dnf autoremove
sudo dnf clean packages
df -h  # Check disk space

Package Manager Recovery:

# Rebuild RPM database if corrupted
sudo rpm --rebuilddb

# Verify package integrity
sudo rpm -Va

# Fix broken dependencies
sudo dnf distro-sync

# Reset to clean state
sudo dnf history undo last

Emergency Recovery:

# If system won't boot after update:
1. Boot from rescue mode (GRUB menu)
2. Select older kernel version
3. Roll back problematic update:
   sudo dnf history list
   sudo dnf history undo [ID]

# Check what update caused issue:
dnf history info last

Amazing! ๐ŸŒŸ Update troubleshooting mastered!

๐ŸŽฎ Quick Examples

Practice with real-world scenarios! ๐ŸŽฏ

Example 1: Weekly Maintenance Routine

#!/bin/bash
# Weekly update script

echo "๐Ÿ”„ Starting weekly system maintenance..."

# Check system status
echo "๐Ÿ“Š Current system:"
cat /etc/redhat-release
uptime

# Update package cache
echo "๐Ÿ“ฅ Refreshing package cache..."
sudo dnf makecache

# Check for updates
echo "๐Ÿ” Checking for updates..."
UPDATE_COUNT=$(dnf check-update | wc -l)
echo "Found $UPDATE_COUNT available updates"

# Install security updates
echo "๐Ÿ›ก๏ธ Installing security updates..."
sudo dnf --security update -y

# Clean up
echo "๐Ÿงน Cleaning up..."
sudo dnf autoremove -y
sudo dnf clean packages

# Show summary
echo "โœ… Maintenance complete!"
echo "๐Ÿ“Š System status:"
df -h /
free -h

Example 2: Server Update with Verification

# Pre-update backup
echo "๐Ÿ’พ Creating system snapshot..."
sudo systemctl stop important-service
sudo tar -czf /backup/etc-backup-$(date +%Y%m%d).tar.gz /etc

# Update with verification
echo "๐Ÿ”„ Updating system..."
sudo dnf update -y

# Verify critical services
echo "๐Ÿ” Verifying services..."
sudo systemctl status sshd
sudo systemctl status NetworkManager
sudo systemctl status firewalld

# Test network connectivity
ping -c 3 google.com

# Start services
sudo systemctl start important-service

echo "โœ… Update complete and verified!"

Example 3: Selective Package Updates

# Update only web server components
sudo dnf update httpd php* mariadb*

# Update development tools
sudo dnf group update "Development Tools"

# Update security tools only
sudo dnf update --security \
    firewalld \
    openssh* \
    openssl*

# Update system libraries
sudo dnf update glibc* \
    systemd* \
    kernel*

echo "๐ŸŽฏ Selective updates complete!"

Example 4: Update Monitoring Script

#!/bin/bash
# Monitor system updates

# Check last update
LAST_UPDATE=$(stat -c %Y /var/log/dnf.log)
CURRENT_TIME=$(date +%s)
DAYS_SINCE=$(( (CURRENT_TIME - LAST_UPDATE) / 86400 ))

echo "๐Ÿ“… Days since last update: $DAYS_SINCE"

# Alert if too old
if [ $DAYS_SINCE -gt 7 ]; then
    echo "โš ๏ธ  System needs updates!"
    dnf check-update | head -10
    echo "๐Ÿ’ก Run: sudo dnf update"
else
    echo "โœ… System is up to date"
fi

# Security updates available?
SECURITY_UPDATES=$(dnf --security check-update 2>/dev/null | wc -l)
if [ $SECURITY_UPDATES -gt 0 ]; then
    echo "๐Ÿšจ $SECURITY_UPDATES security updates available!"
    echo "๐Ÿ”ง Run: sudo dnf --security update"
fi

๐Ÿšจ Fix Common Problems

Update troubleshooting made easy! ๐Ÿ”ง

Problem 1: โ€œNo space left on deviceโ€

Solution:

# Check disk space
df -h

# Clean DNF cache
sudo dnf clean all

# Remove old packages
sudo dnf autoremove -y

# Remove old kernels
sudo dnf remove $(dnf repoquery --installonly --latest-limit=-2 -q)

# Clean logs
sudo journalctl --vacuum-time=7d

# Check space again
df -h

Problem 2: โ€œRepository metadata corruptโ€

Solution:

# Clear all cache
sudo dnf clean all

# Remove cache directory
sudo rm -rf /var/cache/dnf/*

# Rebuild cache
sudo dnf makecache

# Try update again
sudo dnf update

Problem 3: โ€œTransaction check errorโ€

Solution:

# Check for duplicate packages
rpm -qa | sort | uniq -d

# Fix duplicate packages
sudo dnf remove duplicate-package-name

# Rebuild RPM database
sudo rpm --rebuilddb

# Try update with skip-broken
sudo dnf update --skip-broken

Problem 4: Updates Break System

Solution:

# Check update history
dnf history list

# Get details of last update
dnf history info last

# Undo last update
sudo dnf history undo last

# Or rollback to specific point
sudo dnf history rollback ID

๐Ÿ“‹ Simple Commands Summary

TaskCommand
Update everythingsudo dnf update
Security updates onlysudo dnf --security update
Check for updatesdnf check-update
Update specific packagesudo dnf update package-name
Clean cachesudo dnf clean all
Remove unused packagessudo dnf autoremove
Show update historydnf history list
Undo last updatesudo dnf history undo last
Enable auto-updatessudo systemctl enable dnf-automatic.timer

๐Ÿ’ก Tips for Success

Master AlmaLinux updates like a pro! ๐ŸŒŸ

  • ๐Ÿ“… Regular Schedule: Update weekly or bi-weekly
  • ๐Ÿ›ก๏ธ Security First: Install security updates immediately
  • ๐Ÿ’พ Backup Important: Before major updates
  • ๐Ÿ”„ Test Updates: In development environment first
  • ๐Ÿ“Š Monitor Space: Ensure adequate disk space
  • ๐Ÿค– Automate Safely: Use automatic updates for security
  • ๐Ÿ“ Read Changelogs: Understand whatโ€™s changing
  • ๐Ÿ• Update Off-Hours: For servers, update during maintenance windows
  • ๐Ÿ” Verify After: Check that services still work
  • ๐Ÿ“š Stay Informed: Follow AlmaLinux security advisories

๐Ÿ† What You Learned

Congratulations! Youโ€™re now an update expert! ๐ŸŽ‰

  • โœ… Checked system status and available updates
  • โœ… Performed basic and advanced system updates
  • โœ… Configured automatic security updates
  • โœ… Learned update troubleshooting techniques
  • โœ… Created update maintenance routines
  • โœ… Mastered selective package updates
  • โœ… Set up update monitoring
  • โœ… Gained system administration skills

๐ŸŽฏ Why This Matters

Your update mastery keeps systems secure! ๐Ÿš€

  • ๐Ÿ›ก๏ธ Security: Prevent 99% of known vulnerabilities
  • ๐Ÿ’ผ Professional: Essential system admin skill
  • ๐Ÿš€ Performance: Keep systems running optimally
  • ๐Ÿ’ฐ Cost Savings: Prevent security incidents
  • ๐Ÿ”ง Reliability: Reduce system downtime
  • ๐Ÿ“ˆ Compliance: Meet security requirements
  • ๐ŸŒŸ Best Practice: Follow industry standards
  • ๐Ÿง  Knowledge: Understand system maintenance

Youโ€™re now protecting systems like a cybersecurity pro! ๐Ÿ†

Keep updating! ๐Ÿ™Œ