Few Ubuntu errors are as annoying as this one. You try to install a program or run a normal update, and the terminal stops you with a message saying dpkg was interrupted and you must run a repair command manually. Software Center may refuse to open installs too.
This error usually appears after a power cut, a forced shutdown, a closed terminal during an update, or a system freeze while packages were being unpacked. The package system locks itself to protect your software database, and it will not continue until that half-finished work is checked.
The good news is that this is one of the safest errors to fix. In most cases you do not lose any packages, and the full repair takes only a few terminal commands. This guide explains what happened, the correct order to fix it, and how to recover when the simple fix is not enough.
Quick Answer
Open a terminal and run sudo dpkg --configure -a to finish any half-configured packages, then run sudo apt --fix-broken install and sudo apt update && sudo apt upgrade to repair dependencies and complete the update. This fixes the interrupted dpkg error in most cases without removing your installed programs. Reboot when the commands finish without errors.
What the Dpkg Was Interrupted Error Actually Means
Ubuntu installs software with two tools that work together. The lower tool is dpkg, which unpacks and configures individual package files. The higher tool is APT, which downloads packages, works out dependencies, and calls dpkg to do the actual work.
When dpkg says it was interrupted, it means a previous run stopped in the middle of configuring a package. The package might be unpacked but not set up, or its setup script may have run only halfway. Dpkg records this state carefully, and it refuses new work until the old work is either finished or rolled back cleanly.
This is a protective feature. Your documents are not involved. Only the package database needs attention.
Common Causes
- The laptop battery died or power was cut during an update.
- The terminal window was closed while an install was running.
- The computer was forced off with the power button during an upgrade.
- The system ran out of disk space in the middle of unpacking packages.
- A package setup script froze and the process was killed.
Before You Start: Simple Safety Checks
- Plug in your laptop charger. Do not run the repair on a low battery.
- Check free space with
df -h. If the root partition shows 100 percent used, free space first or the repair will fail again. - Close Software Center, Synaptic, and any other package tools. Only one package tool can run at a time.
- Make sure your internet connection is working, because the later steps may need to download missing dependencies.
The Standard Fix: Step by Step
Follow these steps in order. Do not skip the first command and jump straight to installing new software.
Step 1: Finish Configuring Pending Packages
- Open a terminal with
Ctrl + Alt + T. - Run
sudo dpkg --configure -a. The--configureoption tells dpkg to set up every unpacked but unconfigured package, and-ameans all of them. - Watch the output. You may be asked questions by a package, for example about keeping a config file. Read each prompt and choose the default unless you have a reason not to.
- Wait until the command returns to the prompt with no error. On a slow machine with many pending packages, this can take several minutes.
Step 2: Fix Broken Dependencies
- Run
sudo apt --fix-broken install. APT will check the full dependency tree and suggest downloads, removals, or configuration steps to make it consistent. - Read the plan before pressing
Y. A small list is normal. If it wants to remove hundreds of packages or your desktop environment, stop and read the recovery section below instead. - Let the command finish completely.
Step 3: Update and Complete the Upgrade
- Refresh package lists with
sudo apt update. - Complete any remaining upgrades with
sudo apt upgrade. - Remove packages that are no longer needed with
sudo apt autoremove. - Reboot with
sudo rebootif a kernel, driver, or core library was part of the interrupted update.
After the reboot, run sudo apt update again. If no warning appears, the system is repaired.
The official Ubuntu APT how-to documentation covers these repair options and explains how APT and dpkg fit together.
If Dpkg –Configure -a Fails on One Package
Sometimes one specific package is damaged and blocks all the others. The error output will name it. Here is how to handle that safely without losing the rest of your system.
Identify and Reinstall the Problem Package
- Note the exact package name in the error, for example in a line saying it failed to configure.
- Try reinstalling it with
sudo apt install --reinstall PACKAGENAME, replacing the name with the real one. - If reinstall is blocked, remove only that package with
sudo dpkg --remove --force-remove-reinstreq PACKAGENAME, then runsudo apt --fix-broken installand install it again fresh if you still need it. - Run
sudo dpkg --configure -aonce more to confirm nothing else is pending.
Check for a Full Disk or Broken Download Cache
- Clean the download cache with
sudo apt cleanif a corrupted download is suspected. - Check the boot partition with
df -h /boot. Old kernels filling/bootare a classic cause of interrupted upgrades on older installs. - Remove old kernels safely through
sudo apt autoremove --purgeafter the main repair succeeds, not before.
If your system also struggles with manual package files, our walkthrough on how to install a DEB file correctly in Ubuntu shows how to check dependencies before installing a local package.
Understanding Lock File Warnings
Many users confuse the interrupted error with a lock warning such as could not get lock or waiting for cache lock. These are different problems.
A lock warning usually means another package process is genuinely running, perhaps an automatic update in the background. The correct response is to wait a few minutes or reboot and try again. You can check with ps aux | grep apt to see if a process is active.
Only if you are completely sure no package process is running, and a reboot did not clear it, do experienced users remove lock files such as /var/lib/dpkg/lock-frontend. Doing this while a process is alive can corrupt the database, which is far worse than the original error. For the interrupted error in this guide, you normally never need to touch lock files at all. The official dpkg manual page for Ubuntu documents the configure option and the package states in full detail.
How to Prevent the Error From Coming Back
- Never close the terminal or shut down during an update, even if it looks frozen. Give large upgrades at least fifteen minutes.
- Keep at least a few gigabytes free on your root partition at all times.
- Run updates regularly in small batches instead of saving hundreds for one long session.
- Use a stable power source for laptops during release upgrades.
- Avoid mixing many third-party package sources that can create dependency conflicts.
Common Mistakes and Useful Tips
- Deleting the dpkg status file: Never delete
/var/lib/dpkg/status. That file is the record of everything installed. Deleting it makes the problem dramatically worse. - Running random force commands: Force options have a place, but only aimed at the one named broken package, never at the whole system.
- Ignoring the removal plan: Always read what
apt --fix-broken installwants to remove before confirming. A plan that removes your desktop is a warning sign, not a routine step. - Reinstalling Ubuntu too soon: This error looks dramatic but is almost always repairable in minutes. A reinstall is a last resort for a damaged database that no repair command can read.
- Tip: After a successful repair, run
dpkg -l | grep ^..rto spot any packages still in a requested-remove state and clean them up calmly. - Tip: Keep a short note of what was being installed when the interruption happened. Reinstalling that one program after the repair confirms everything works.
Conclusion
The dpkg was interrupted error is Ubuntu protecting its package database after an install stopped halfway. It is not data loss, and it does not mean your programs are gone. The system simply wants you to finish the pending work before starting anything new.
Run sudo dpkg --configure -a first, follow it with the APT broken-install repair, then update and upgrade as normal. Handle a single stubborn package individually if one is named in the errors, and keep enough free disk space and stable power for future updates. With that order followed, almost every system returns to normal updates without losing a single needed package.
Frequently Asked Questions
Will running dpkg –configure -a remove my programs?
No. The command configures packages that are already unpacked on your system. It does not uninstall your programs or delete your personal files.
How long should the repair command take?
Usually one to five minutes. If many packages were pending or a large program was halfway through setup, it can take longer. Let it finish without closing the terminal.
What if the error returns after every update?
That points to a deeper cause such as a failing disk, a nearly full boot partition, or one package whose setup script always fails. Check disk space and disk health, and note which package name appears every time.
Can I use Software Center instead of the terminal for this fix?
Not for the main step. The configure command must be run in a terminal because the graphical tools themselves depend on dpkg being in a healthy state first.
What does half-installed mean in the package list?
It means the package files are present but its configuration did not complete. The configure command in this guide is designed exactly to finish those packages and clear that state.


Leave a Reply