dpkg lock Linux Origin: Platform & cloud OSI layer 7 · Application Last updated 13 Oct 2026

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.

Exact message you may see Could not get lockUnable to acquire the dpkg frontend lockis another process using it
Seen on: Linux

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

  1. Wait a few minutes and retry
  2. See what holds it: sudo lsof /var/lib/dpkg/lock-frontend
  3. If nothing runs: sudo dpkg --configure -a
  4. Never delete lock files while apt/dpkg is running

Detailed fix by platform

Linux

  1. 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

  1. Holder — Which process owns the lock?
  2. 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:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

command not found — bash: command not found (Linux)command not founddpkg was interrupted — E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem (Linux)dpkg was interruptedEACCES — Linux: Permission denied (Linux)EACCESerror while loading shared libraries — error while loading shared libraries: libX.so.N: cannot open shared object file: No such file or directory (Linux)error while loading s…Failed to download metadata for repo — Error: Failed to download metadata for repo 'appstream' (dnf / yum) (Linux)Failed to download me…grub rescue unknown filesystem — error: unknown filesystem. Entering rescue mode... grub rescue> (Linux)grub rescue unknown f…gzip: stdin: not in gzip format — gzip: stdin: not in gzip format / tar: Error is not recoverable: exiting now (Linux)gzip: stdin: not in g…held broken packages — Unmet dependencies / E: Unable to correct problems, you have held broken packages (Linux)held broken packagesdpkg lock

Explore the map of this error Full error map →

🧠 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.