Dpkg Was Interrupted You Must Manually Run Sudo Dpkg Configure To Correct The Problem Top

dpkg (Debian Package Manager) is the low-level engine behind apt, apt-get, and the Ubuntu Software Center. Unlike a simple file copy, installing a package involves unpacking files, running pre/post-installation scripts, updating databases, and configuring dependencies.

If that process is interrupted—by a power failure, a closed terminal window, a network timeout, or a Ctrl+C at the wrong moment—dpkg leaves a lock file behind. This lock tells the system: "I was in the middle of something critical. Do not proceed until I’m cleaned up."

The result? Every subsequent package operation fails with the same message.

If the system believes another process is using the package manager (even if nothing is running), you may need to remove the lock files manually.

Warning: Ensure you do not have any other terminals open or Software Centers running before executing these commands. dpkg (Debian Package Manager) is the low-level engine

sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock
sudo rm /var/cache/apt/archives/lock

After removing the locks, run the configuration command again:

sudo dpkg --configure -a

The best fix is prevention. Follow these best practices:

Never close the terminal during apt operations
Avoid Ctrl+C while dpkg is running (use only as last resort)
Use screen or tmux for long operations over SSH
Keep your system on a UPS during critical updates
Run sudo apt update before any major install/upgrade

Regularly clean up with:

sudo apt autoclean
sudo apt autoremove

dpkg (Debian Package Manager) is the low-level tool that installs, configures, and removes .deb packages on Debian, Ubuntu, and derivatives. The message indicates dpkg was stopped mid-operation (power failure, forced shutdown, killed process, or another package tool interrupted it). Because package installation/configuration is transactional and can leave system state inconsistent, dpkg refuses to continue until you explicitly recover.

The error message actually tells you exactly what to do—a rarity in Linux troubleshooting.

Run this in your terminal:

sudo dpkg --configure -a

Breakdown:

After running this, dpkg will resume exactly where it left off. You’ll see it unpack, configure, and finalize the interrupted package. Once it finishes, normal apt operations will work again.

To avoid recurrence of this issue:

You included the word “top” at the end of your keyword: “dpkg was interrupted you must manually run sudo dpkg configure to correct the problem top.”

This likely comes from two possible sources: After removing the locks, run the configuration command

If you meant the top command: after fixing dpkg, simply type top in the terminal. If top fails with “command not found,” install it via sudo apt install procps. If top shows high CPU usage, check if a stuck dpkg process lingers (use ps aux | grep dpkg and kill it with sudo kill -9 [PID]).

For the rest of this article, we’ll assume “top” refers to troubleshooting top-level solutions—including advanced fixes when the basic command fails.