E: Could not get lock /var/lib/dpkg/lock-frontend — is another process using it?
apt can’t run because another package operation (often automatic updates) holds the dpkg lock.
Could not get lockUnable to acquire the dpkg frontend lockis another process using it Meaning
Only one apt/dpkg process may run at a time. On fresh servers, unattended-upgrades frequently runs right after boot. Deleting the lock files while a process is running can corrupt the package database.
Common causes
- unattended-upgrades / apt-daily running
- Another terminal or script running apt
- A previous apt run crashed and left dpkg half-configured
⚡ Quick fix
- Wait a few minutes and retry
- See what holds it:
sudo lsof /var/lib/dpkg/lock-frontend - If nothing runs:
sudo dpkg --configure -a - Never delete lock files while apt/dpkg is running
Detailed fix by platform
Linux
- Find the holder and recover:bash
ps aux | grep -E 'apt|dpkg|unattended' | grep -v grep sudo lsof /var/lib/dpkg/lock-frontend # only when no apt/dpkg process is running: sudo dpkg --configure -a sudo apt -f install
How to diagnose
- Holder — Which process owns the lock?
- State — Interrupted dpkg run?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Linux
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 13 Oct 2026