Common Debian System Errors and How to Fix Them
Here are the most frequently encountered real-world errors on Debian systems (especially Debian 12 Bookworm → Debian 13 Trixie transition period, 2025–2026), ordered roughly by how often administrators see them.
For each error I include:
- typical full message or symptom
- most common root causes in production
- the fastest & safest way to diagnose
- the usual fix (with reasoning)
1. “E: Unable to locate package …”
Symptom E: Unable to locate package nginx / E: Package ‘docker-ce’ has no installation candidate
Most common causes (2026)
- Forgot to run apt update after adding a new repository
- Typo in package name
- Trying to install a package from a different suite (testing/sid) without proper pinning
- Third-party repo added but architecture or release codename mismatch (e.g. bookworm vs trixie)
Quick diagnosis
apt update
apt search ^package-name
apt policy package-name
lsb_release -sc # check codename
Fixes (in order of preference)
- sudo apt update && sudo apt install <correct-package-name>
- For Docker / NVIDIA / VirtualBox / etc. → follow official instructions exactly (they usually provide ready-to-paste sources.list.d file)
- If you added a PPA-style repo → verify /etc/apt/sources.list.d/*.list contains correct codename (trixie, not bookworm)
2. “The following packages have unmet dependencies”
Symptom The following packages have unmet dependencies: … E: Unable to correct problems, you have held broken packages.
Most common causes
- Mixed suites without proper pinning (stable + testing + backports)
- Held packages (apt-mark hold)
- Third-party repo with newer version conflicting with Debian dependencies
- Interrupted apt run → inconsistent state
Quick diagnosis
apt update
apt list --upgradable
apt-mark showhold
apt policy <problem-package>
Fixes
- sudo apt update && sudo apt install -f (most common quick fix)
- sudo apt full-upgrade (allows removals)
- sudo apt-mark unhold <package> if you see held packages
- Remove or comment out problematic third-party repos temporarily
- Use aptitude interactive resolver when desperate (it suggests more solutions)
3. “dpkg was interrupted, you must manually run ‘dpkg –configure -a’”
Symptom Package manager stuck after power loss / Ctrl+C / crash
Fix
sudo dpkg --configure -a
sudo apt install -f
Why it happens dpkg uses lock files and state tracking — interruption leaves packages in half-configured state.
Prevention tip Use tmux or screen when doing long upgrades over SSH.
4. “Failed to start … Unit … has begun starting up again (restart limit reached).”
Symptom journalctl -u nginx or systemctl status mariadb shows restart loop
Most common causes
- Configuration syntax error
- Missing directory / permission denied
- Port already in use
- Out of memory / too many open files
Quick diagnosis
sudo journalctl -u servicename -xe # last errors
sudo systemctl status servicename --no-pager -l
sudo ss -tulnp | grep :80 # port conflict example
Fix pattern
- Fix obvious config error → systemctl restart servicename
- Check permissions: ls -ld /var/lib/mysql / /var/log/nginx
- Increase limits if OOM-related: /etc/systemd/system/<service>.d/override.conf
5. “ssh_exchange_identification: read: Connection reset by peer”
Symptom Cannot SSH after hardening or reboot
Most common causes (after hardening guide)
- PermitRootLogin no + trying to login directly as root
- PasswordAuthentication no + no key copied
- AllowUsers / AllowGroups doesn’t include your user
- fail2ban banned your IP
- nftables / ufw blocking new port
Quick diagnosis & fix
- Check from console (VPS panel / rescue mode)
- journalctl -u ssh or tail -n 50 /var/log/auth.log
- fail2ban-client status sshd → fail2ban-client set sshd unbanip YOUR.IP
- Verify /etc/ssh/sshd_config syntax: sshd -t
6. “Temporary failure in name resolution”
Symptom ping google.com fails, but ping 8.8.8.8 works
Most common causes
- /etc/resolv.conf overwritten or empty
- systemd-resolved not running
- NetworkManager / systemd-networkd misconfigured DNS
- Container/VM with broken network namespace
Fixes
- systemctl status systemd-resolved → restart if dead
- sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
- Check /etc/systemd/resolved.conf → DNS=8.8.8.8 1.1.1.1
7. “read-only file system” or mount errors on boot
Symptom Boot stuck or root filesystem mounted read-only
Most common causes
- Filesystem errors (power loss, bad sectors)
- fstab typo (wrong UUID, wrong mount point)
- LVM / mdadm / encryption initramfs problem
- Disk full → journald / systemd cannot write
Quick diagnosis (from recovery mode / live USB)
fsck -f /dev/mapper/debian--vg-root
journalctl -b -1 # previous boot
blkid # verify UUIDs in /etc/fstab
Fix pattern
- Run fsck on unmounted filesystem
- Comment out bad line in /etc/fstab
- Regenerate initramfs: update-initramfs -u -k all
8. “No space left on device” (but df shows free space)
Symptom apt, journalctl, logs, services fail — but df -h looks okay
Most common causes
- Inode exhaustion (millions of small files)
- /var/log/journal huge
- Reserved blocks on ext4 (5% default)
Diagnosis
df -i # inode usage
du -shx /var/log/* # log hogs
tune2fs -l /dev/sdX | grep "Reserved block"
Fixes
- journalctl –vacuum-time=2weeks
- apt autoclean && apt autoremove
- Delete old kernels: apt autoremove –purge
- tune2fs -m 1 /dev/sdX (reduce reserved to 1%)
Quick General Recovery Cheat Sheet
| Command | When to use |
|---|---|
| apt update && apt install -f | Almost every package manager problem |
| dpkg –configure -a | dpkg interrupted |
| journalctl -b -p err | See only errors from this boot |
| systemctl –failed | Which services failed to start |
| smartctl -a /dev/nvme0n1 | Check SSD/NVMe health |
| fsck -f /dev/… | Filesystem errors (unmounted!) |
| chroot /mnt rescue-shell commands | Boot repair from live USB |
Most Debian problems are state inconsistencies (package db, systemd units, mounts) rather than deep corruption — which is why the system is usually recoverable with 3–5 commands if you keep calm and read the error messages carefully.
Save this mental checklist — it covers ~85–90% of real incidents you’ll see in production or homelab Debian systems.