In this comprehensive guide, we'll explain exactly what causes this error, how to fix it safely, and how to avoid it in the future. We'll cover everything from the simple one‑command solution to advanced recovery steps if the problem persists.
Sometimes, finishing the interrupted configuration reveals broken dependencies or missing package files. To clean these up, run the following commands in sequence: sudo apt update sudo apt install -f Use code with caution.
No. It only completes pending package configuration. Your personal files are untouched. However, if a package script contains a bug, it might delete configuration files – but that's extremely rare and not a normal behavior.
When this happens, dpkg leaves itself in a locked or unfinished state. Instead of risking corruption, it refuses to run new commands until you clean up the previous one. In this comprehensive guide, we'll explain exactly what
The dpkg (Debian Package) system manages applications on your computer. When you install an update or a new app, dpkg unpacks files and configures them.
After running that, you should be able to use apt normally again.
After removing the lock files, you must force reconfigure the system: sudo dpkg --configure -a Use code with caution. How to Prevent This in the Future To clean these up, run the following commands
If you’ve ever run apt install , apt upgrade , or apt-get and seen this error:
Run the following commands one by one to safely remove the lock files:
-a (or --pending ): Instructs the system to process all pending packages currently in an interrupted state. Your personal files are untouched
Setting up libc6 (2.31-0ubuntu9.9) ... Processing triggers for man-db ... Setting up python3 (3.8.2-0ubuntu2) ...
Sometimes, the configuration command fails because another process holds a "lock" on the package database, or because the lock file was left behind during the initial interruption.
This guide explains why this error happens and provides a step-by-step troubleshooting process to safely fix your package manager. What Causes This Error?
How to Fix "dpkg was interrupted, you must manually run sudo dpkg --configure -a"
After removing the locks, clear the cache and re-attempt the configuration: sudo apt clean sudo dpkg --configure -a Use code with caution. Step 3: Fix Broken Dependencies