sudo dpkg --configure -a
The --pending flag forces dpkg to configure only those packages that are marked as "unpacked but not configured."
If the interruption left dependencies in a messy state, use the APT repair tool : sudo apt-get install -f # OR sudo apt --fix-broken install Use code with caution. Copied to clipboard
The "E: dpkg was interrupted" error occurs on Debian-based systems when package installation or updates are terminated prematurely, leaving packages unconfigured. The standard solution is to run sudo dpkg --configure -a in the terminal to complete pending setups. For more details, visit Ask Ubuntu . E: dpkg was interrupted... run 'sudo dpkg --configure
A system crash forced you to hard-reboot your computer mid-process. Step-by-Step Solutions sudo dpkg --configure -a The --pending flag forces
The after running sudo dpkg --configure -a
If the process is broken during step 2 or 3, the package manager gets stuck in an unstable state. Common triggers include:
This can save you if corruption occurs.
After removing locks, always run the configure command again: For more details, visit Ask Ubuntu
The error message itself is unusually helpful. It literally tells you what command to run:
While you now know how to fix the error, it's better to avoid it entirely. Here are best practices:
If you see lines containing grep only, it means no dpkg process is active.
The command sudo dpkg --configure -a (or --configure --pending ) instructs dpkg to: If the error persists
: A package requires another file that is missing or corrupted.
If you found this guide helpful, share it with fellow Linux users. And remember: when dpkg stumbles, sudo dpkg --configure -a is your best friend.
When in doubt, read the error message carefully. Often, Linux tells you how to fix the problem.
: Tells the system to pick up where it left off and configure any unpacked but unconfigured packages. (or --pending) : Instructs it to process pending packages currently in the queue. If the error persists