Affected versions: RHEL 10

πŸ“– ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution β€” Primary Fix
  7. Solution β€” Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Scheduled updates fail because dnf reports lock held by another process.

Environment & Reproduction

Seen when multiple automation jobs overlap or a previous run crashed.

sudo dnf update -y

Root Cause Analysis

Concurrent package manager invocations or orphaned lock state causes contention.

Quick Triage

Identify active package process and distinguish real lock from stale lock.

ps -ef | grep -E 'dnf|yum|rpm' ; sudo lsof /var/run/dnf.pid

Step-by-Step Diagnosis

Trace automation source and confirm no transaction is still running.

systemctl list-timers | grep -Ei 'dnf|package' ; sudo journalctl -u dnf* -n 100 ; sudo dnf history
Illustrative mockup for rhel-10 β€” dnf-lock-log
Another app is currently holding dnf lock β€” Illustrative mockup β€” Progressive Robot

Solution β€” Primary Fix

Stop overlapping jobs, clear stale lock safely, and rerun transaction.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo pkill -f 'dnf|yum' ; sudo rm -f /var/run/dnf.pid ; sudo dnf clean all ; sudo dnf makecache
Illustrative mockup for rhel-10 β€” dnf-lock-fix
Stale lock resolved and updates resumed β€” Illustrative mockup β€” Progressive Robot

Solution β€” Alternative Approaches

Serialize patch workflows with systemd timers and lock-aware wrappers.

Verification & Acceptance Criteria

A single dnf job runs successfully without lock contention messages.

sudo dnf check-update ; sudo dnf history info last

Rollback Plan

Restore original timer schedule if serialization change delays urgent patch windows.

sudo systemctl restart dnf-automatic.timer

Prevention & Hardening

Use one package orchestration authority per host and audit timer overlap.

Correlates with rpmdb corruption risk when transactions are force-killed.

Related tutorial: View the step-by-step tutorial for rhel-10.

View all rhel-10 tutorials on the Tutorials Hub β†’

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

dnf-automatic and systemd timer coordination practices for RHEL.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β€” we respond within one business day.