Most Debian server problems fall into a handful of patterns. Here are the errors you’re most likely to see, what causes them and how to fix them safely.
1. “Could not get lock /var/lib/dpkg/lock-frontend”
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 1234 (apt-get)
Cause: another package operation is running — often automatic updates (unattended-upgrades) right after boot.
Fix: wait a few minutes and check what’s running:
ps aux | grep -E 'apt|dpkg' | grep -v grep
Don’t delete lock files while a process holds them. If the process is gone (for example after a crash) and the lock remains:
dpkg --configure -a
apt -f install
2. Broken or half-installed packages
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages
apt --fix-broken install
dpkg --configure -a
apt update && apt full-upgrade
If a single package’s install script fails repeatedly, read the error above the summary — it usually names a config file or service that’s the real problem.
3. Repository and GPG errors
NO_PUBKEY 1234ABCD… or The repository '…' does not have a Release file
Causes: a third-party repository’s key isn’t installed, the repository was removed, or you’re on an end-of-life Debian release.
- For third-party repos, follow the vendor’s current instructions — modern Debian uses keys in
/etc/apt/keyrings/referenced withsigned-by=in the source line;apt-keyis deprecated. - Remove repos you no longer need from
/etc/apt/sources.list.d/. - Check your release:
cat /etc/debian_version. Old releases move toarchive.debian.organd stop receiving security updates — plan an upgrade.
4. “No space left on device”
df -h # which filesystem is full?
df -i # out of inodes (many tiny files)?
du -xh / --max-depth=1 2>/dev/null | sort -h | tail
Usual suspects and fixes:
journalctl --vacuum-size=200M # systemd journal
apt clean # downloaded packages
find /var/log -name '*.gz' -mtime +14 -delete
docker system prune # if you use Docker
Also check for deleted files still held open by a process: lsof +L1. Restart that service to free the space.
5. “Read-only file system”
The kernel remounted the filesystem read-only after detecting errors. Check the cause:
dmesg | grep -iE 'ext4|xfs|i/o error'
Back up important data, then run a filesystem check from rescue mode or at boot. See Linux filesystem journaling.
6. A service fails to start
systemctl status nginx
journalctl -u nginx -b --no-pager | tail -50
Common causes:
- Configuration syntax error — test before restarting:
nginx -t,apachectl configtest,sshd -t,php-fpm8.2 -t. - Port already in use —
ss -ltnp | grep ':80'. - Permissions — the service user can’t read a file or certificate.
7. DNS doesn’t resolve
Temporary failure in name resolution
cat /etc/resolv.conf
ping -c2 1.1.1.1 # network OK?
getent hosts debian.org # DNS OK?
If IPs work but names don’t, fix the nameservers — see Debian network configuration.
8. Locked out of SSH
After changing SSH settings or the firewall, you may lose access. Use the VNC console in your VPS control panel to log in, then:
sshd -t # config errors
systemctl status ssh
ufw status # is port 22 (or your custom port) allowed?
Always test SSH changes in a second session before closing the first. More in SSH security on Debian.
9. Out of memory: processes killed
journalctl -k | grep -i 'out of memory'
The kernel’s OOM killer stopped a process (often MySQL or PHP). Reduce worker counts, add a swap file as a buffer (see swap file vs partition), or move to a plan with more RAM.
10. Clock is wrong
TLS errors and failed apt updates can come from a wrong system time:
timedatectl
timedatectl set-ntp true
Prevention
Keep the system updated, monitor disk usage, and back up regularly. Our Debian VPS plans include a VNC console and OS reinstall in the control panel, so you can always recover access.