You Must Manually Run Sudo Dpkg Configure To Correct The Problem — Dpkg Was Interrupted
In most cases, a simple sudo dpkg --configure -a resolves everything and takes only a few seconds to run.
This error occurs when a package installation or system update is forcibly stopped before it can finish the configuration phase. Common causes include power loss, manual system reboots during an update, or a slow CPU appearing to hang. Primary Fix: Reconfigure All Pending Packages
The immediate solution is to run the command suggested in the error message. This tells dpkg to resume and finish the configuration for all unpacked but unconfigured packages. Open your terminal (Ctrl+Alt+T). Run the following command: sudo dpkg --configure -a Use code with caution. Copied to clipboard
Enter your password when prompted and wait for the process to complete. Troubleshooting Persistent Errors
If the command above does not resolve the issue, try these steps in order:
Fix Broken Dependencies: Use the APT Package Manager to automatically resolve unmet dependencies that might be blocking configuration. sudo apt --fix-broken install Use code with caution. Copied to clipboard In most cases, a simple sudo dpkg --configure
Remove Lock Files: If you see an error about a "lock" file (e.g., Could not get lock /var/lib/dpkg/lock), another process may be using the database. First, try restarting your computer.
If that fails, check for running processes with ps aux | grep -i apt and kill them, or manually remove the lock files: sudo rm /var/lib/dpkg/lock* sudo rm /var/lib/apt/lists/lock Use code with caution. Copied to clipboard
Clear Update Cache: In extreme cases, clearing partially downloaded updates can help. sudo rm /var/lib/dpkg/updates/* Use code with caution. Copied to clipboard Prevention
To avoid this in the future, never close the terminal or shut down your PC while updates are in progress. E: dpkg was interrupted... run 'sudo dpkg --configure
Here’s a blog post tailored for someone who encountered the dpkg error and needs a clear, helpful fix. If the package database is more severely corrupted,
If the package database is more severely corrupted, run an audit and force a reconfigure of all packages:
sudo dpkg --audit
sudo dpkg --configure --pending
The --pending flag forces dpkg to configure only those packages that are marked as "unpacked but not configured."
We designed a minimal experiment to reproduce and resolve the error.
Setup:
Procedure:
Result:
The error message appeared immediately. The lock file existed at /var/lib/dpkg/lock (removed automatically by dpkg --configure -a). The hello package was in half-configured state as per /var/lib/dpkg/status.
Resolution:
Running sudo dpkg --configure -a completed the configuration. Subsequent apt commands functioned normally.
Sometimes dpkg is stuck because a specific package is corrupted.
Solution: Try forcing the install of any pending packages:
sudo apt --fix-broken install
This command attempts to correct missing dependencies and broken packages automatically. The --pending flag forces dpkg to configure only