Fix yum that will not update
We'll check connectivity, repo config, disk space, and locks—then fix repo URLs, GPG keys, or metadata—or tell you when to escalate.
What you'll need
- SSH or console access with sudo
Step-by-step diagnostic
Quick triage — pick your path
Get started
Choose the option that matches what you see. You can jump straight to that section.
Show full guide
Steps
Goal: Check connectivity, repo config, disk space, and locks—then fix repo URLs, GPG keys, or metadata.
- Run
sudo yum updateorsudo yum check-update. Note the exact error. - Good: You see a specific error (connection, 404, GPG, disk full, lock). Proceed to Check connectivity.
- Bad: yum hangs—check connectivity and timeouts.
Check error and connectivity
Goal: Confirm the error and test repo reachability.
- Run
yum repolistand inspect/etc/yum.repos.d/*.repofor baseurl or mirrorlist. - Test with
curl -I <baseurl>orpingthe host. If unreachable, the repo URL or mirror is wrong. - Run
df -hand confirm/and/varhave free space. yum needs space in/var/cache/yum. - Good: Repo is reachable and disk has space. Proceed to Fix repo config if needed, or Clear metadata.
- Bad: Repo unreachable or disk full—fix the repo URL or free space first.
Fix repo config
Goal: Fix baseurl or mirrorlist so yum can reach the repo.
- Edit the .repo file in
/etc/yum.repos.d/. Set baseurl to a known-good mirror (e.g. vault.centos.org for old CentOS). Check that enabled=1. - Run
sudo yum clean allandsudo yum makecache. Retrysudo yum update. - If the error is GPG-related, import the key with
sudo rpm --import <key-url>or temporarily set gpgcheck=0 to test—do not leave disabled in production. - Good: Metadata loads and packages update. Bad: Same error—check connectivity again or escalate.
Clear metadata
Goal: Remove corrupted metadata and retry.
- Run
sudo yum clean allto clear cached metadata. Thensudo yum makecacheandsudo yum update. - Good: Update succeeds. Bad: Escalate with the error and repo config.
When to escalate
Escalate if:
- The repo is managed by a central team and you cannot change it.
- The mirror is enterprise-internal and unreachable from your network.
- The fix requires network or firewall changes outside your control.
Provide: the yum error, yum repolist output, and contents of /etc/yum.repos.d/*.repo.
Verification
sudo yum updateorsudo yum check-updatecompletes without errors.- Packages install or update successfully.
- No GPG or connection errors in the output.
Escalation ladder
Work from the device outward. Stop when the problem is fixed.
- Capture error Run yum update; note exact error.
- Connectivity and disk Test repo URL with curl; check df -h.
- Repo config Edit baseurl/mirrorlist; yum clean all; makecache.
- GPG keys Import correct key or temporarily disable gpgcheck to test.
- Escalate Enterprise-managed repo or infrastructure change needed.
What to capture if you need help
Before calling support or posting for help, have these ready. It speeds everything up.
- Exact yum error message
- Output of yum repolist
- Contents of /etc/yum.repos.d/*.repo
- df -h and disk usage
Does yum update show a specific error?
Run sudo yum update and note the error: connection, 404, GPG, disk full, or lock.
You can change your answer later.
Check connectivity and timeouts
Can you reach the repo URL?
Test with curl -I or ping. Repo must return HTTP 200 or be reachable.
You can change your answer later.
Fix repo URL and retry
Is disk space sufficient?
yum needs space in /var and /var/cache/yum.
You can change your answer later.
Is another yum process holding the lock?
Only one yum process can run at a time.
You can change your answer later.
Wait or remove stale lock
Is the error GPG-related?
GPG key retrieval failed or GPG check failed.
You can change your answer later.
Import GPG key and retry
Clear metadata and retry
Escalate
Reviewed by Blackbox Atlas
Frequently asked questions
- Why would yum update fail?
- Network or repo URL unreachable, expired or wrong GPG key, full disk, another yum/dnf process holding the lock, or corrupted metadata. Check the error message first.
- Can I fix yum update myself?
- Yes. Check connectivity, repo config, disk space, and locks. Fix baseurl, import GPG keys, clear metadata with yum clean all, or remove stale lock files.
- When should I escalate yum update failures?
- If the repo is enterprise-managed and you cannot change it, or the fix requires infrastructure changes outside your control.
Rate this guide
Was this helpful?
Thanks for your feedback.