Fix common apt and dnf errors
Updated 27 Nov 2026 apt dnf
Deal with locks, interrupted installs and broken dependencies.
"Could not get lock"
Another update is running, often the automatic one. Wait, and see what it is:
ps aux | grep -E 'apt|dpkg|unattended' | grep -v grep
Do not delete lock files while a process holds them.
Interrupted install
sudo dpkg --configure -a
sudo apt -f install
Repository errors
Read which source fails in the output of sudo apt update. Remove or correct that file under /etc/apt/sources.list.d/. Never disable signature checking.
No space left
See Disk full. /boot can also fill with old kernels: sudo apt autoremove --purge.
dnf
sudo dnf clean all
sudo dnf makecache
sudo dnf check
Time-related errors
"Release file is not valid yet" means the clock is wrong. See time sync.