π ~1 min read
Table of contents
Symptom & Impact
yum exits with a lock error and package operations cannot proceed.
Environment & Reproduction
You see messages about /var/run/yum.pid and incomplete transactions.
Root Cause Analysis
A previous yum process, PackageKit, or automation job still owns the lock or left a stale pid file.
Quick Triage
Check active package jobs with ps, verify recent failures in journalctl, and confirm no maintenance service is running.
Step-by-Step Diagnosis
Run ps -ef | grep -E ‘yum|rpm’, cat /var/run/yum.pid, yum history, and journalctl -u packagekit for clues.

Solution – Primary Fix
Stop conflicting service jobs with systemctl or service, remove only stale pid files, run yum-complete-transaction, then retry yum update.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Confirm yum repolist and a small yum install complete without lock errors.
Verification & Acceptance Criteria
If issue worsens, restore rpmdb backup and revert recent package transaction from yum history undo.
Rollback Plan
Avoid parallel patch jobs and serialize cron workflows that call yum.
Prevention & Hardening
Use a shell guard that checks lock state before running yum and logs to journalctl.
Related Errors & Cross-Refs
On RHEL 7, service wrappers still exist, but systemctl should be preferred for consistency.
Related tutorial: View the step-by-step tutorial for rhel-7.
View all rhel-7 tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Escalate when rpmdb corruption appears or repeated lock contention impacts production patch windows.
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.