While many Linux errors are distribution-agnostic, Debian has its own specific quirks and common error messages. This guide covers the ones administrators frequently encounter.
"E: Unable to locate package"
sudo apt update
Almost always resolved by refreshing package lists first; if it persists, verify the package name is correct and that the relevant repository component (main/contrib/non-free) is actually enabled in your sources.
"dpkg: error processing package (--configure)"
sudo dpkg --configure -a
Indicates an interrupted package installation/configuration — this command attempts to complete any pending configuration steps.
"E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a'"
The system is explicitly telling you the fix — run the suggested command, typically caused by a system reboot or crash during a package operation.
"NO_PUBKEY" GPG Errors
sudo apt-key list
A repository's signing key is missing or expired — see How to Manage Debian's APT Sources and Repositories for the correct modern approach to adding repository keys.
"Held broken packages"
sudo apt install -f
Attempts to resolve dependency conflicts automatically — if this doesn't fully resolve it, investigate the specific conflicting packages more closely with apt-cache policy.
"The following packages have unmet dependencies"
Often caused by mixing packages from different release channels (Stable + Testing, for example) without proper pinning (see Debian Package Pinning) — review whether you've inadvertently introduced conflicting repository sources.
"Package is not configured yet"
sudo dpkg --configure -a
sudo apt install -f
Locale-Related Warnings ("perl: warning: Setting locale failed")
sudo dpkg-reconfigure locales
A common Debian minimal-image issue — select and generate your needed locale(s) through this reconfiguration.
"insserv: warning: script X missing LSB tags"
Generally a harmless warning related to older-style init scripts not fully following modern conventions — rarely requires action on a modern systemd-based Debian system.
"E: Could not get lock /var/lib/dpkg/lock-frontend"
ps aux | grep -i apt
Another apt/dpkg process is currently running — wait for it to complete, or if genuinely stuck (verify no legitimate process is actually running), the lock file can be manually removed as a last resort, though this risks package database corruption if done carelessly.
Debugging Approach for Unfamiliar Errors
- Read the exact error message carefully — Debian's package tools are often quite specific about the actual problem
- Try the suggested remediation command if one is provided in the error output
- Check
/var/log/apt/history.logand/var/log/dpkg.logfor additional context around when the issue started
Continue Reading
- How to Manage Debian's APT Sources and Repositories
- Debian Package Pinning: Controlling Which Repository Versions Are Used
- How to Use apt/dpkg Effectively: Package Management Deep Dive
Browse more articles in Debian VPS Tutorials.