If you’ve been using Ubuntu for a while, chances are you’ve run into package-related issues at least once. A failed update, an interrupted installation, or conflicting dependencies can easily leave your system in a messy state. When that happens, you’ll often see errors like “broken packages”, “unmet dependencies”, or “dpkg was interrupted”.
This guide is a complete, practical walkthrough on How to Fix Broken Packages in Ubuntu—written for real users, real systems, and real problems. Whether you’re a beginner or an advanced Linux user, this article will help you diagnose the issue, fix it safely, and prevent it from happening again.
What Are Broken Packages in Ubuntu?
In Ubuntu, a package is a bundled piece of software managed by tools like APT and dpkg. A package is considered broken when:
- Required dependencies are missing or incompatible
- Installation or upgrade was interrupted
- Conflicting versions of the same package exist
- Repositories are misconfigured or outdated
When packages break, Ubuntu’s package manager refuses to proceed with installs or updates until the problem is resolved.
Common Signs of Broken Packages
You may be dealing with broken packages if you see errors like:
E: Unmet dependenciesE: Unable to correct problems, you have held broken packagesdpkg was interrupted, you must manually run 'dpkg --configure -a'- Software Center not opening or crashing
apt installorapt upgradefailing repeatedly
If any of these sound familiar, don’t worry—most broken package issues are recoverable.
How to Fix Broken Packages in Ubuntu
Method 1: Use APT to Fix Broken Packages Automatically
When Ubuntu shows broken package errors, the package manager usually already knows what went wrong. The command:
sudo apt --fix-broken install
What this command does:
- Attempts to fix dependency issues
- Installs missing dependencies
- Removes partially installed packages if needed
After running it, try updating again:
sudo apt update
sudo apt upgrade
If this works, your problem may already be solved.
Method 2: Configure Unfinished Packages Using dpkg
Sometimes installations stop halfway—maybe due to a power cut, system crash, or forced shutdown. When that happens, Ubuntu marks packages as unconfigured.
sudo dpkg --configure -a
Why this method is important:
- It completes pending setup scripts
- It fixes packages that were installed but never configured
- It restores the package database to a consistent state
This command does not install anything new. It simply completes incomplete installations, which often removes errors blocking further updates.
Once done, follow it with:
sudo apt --fix-broken install
Method 3: Identify and Remove Held Packages
Held packages are packages that Ubuntu refuses to upgrade, usually because:
- A version conflict exists
- The package was manually pinned
- A dependency requires a specific version
You can check them us
apt-mark showhold
Remove the hold:
sudo apt-mark unhold package-name
After unholding, update your system again:
sudo apt update && sudo apt upgrade
Why held packages cause problems:
When APT tries to upgrade your system, held packages act like roadblocks, preventing dependency resolution.
Unholding them allows Ubuntu to:
- Upgrade dependencies correctly
- Replace outdated versions
- Resolve conflicts naturally
Once unheld, package management becomes flexible again.
Method 4: Clean APT Cache and Rebuild Package Lists
Corrupted cache files can cause persistent package errors.
Step 1: Clean the cache
sudo apt clean
sudo apt autoclean
Step 2: Remove unused dependencies
sudo apt autoremove
Step 3: Refresh package lists
sudo apt update
What this method really does:
- Deletes old and broken package files
- Removes unused dependencies
- Clears clutter that confuses the package manager
This method is like clearing browser cache—it doesn’t harm anything, but it often fixes strange behavior.
Method 5: Manually Remove a Problematic Package
Sometimes one specific package refuses to behave. It might:
- Fail during installation every time
- Block updates
- Break dependency chains
Using dpkg with force options allows you to remove that one broken link.
Find broken packages:
dpkg -l | grep ^..r
Remove the package:
sudo dpkg --remove --force-remove-reinstreq package-name
Then fix dependencies:
sudo apt --fix-broken install
Why this works:
- It removes partially installed packages
- It clears dependency loops
- It allows APT to rebuild a clean dependency tree
This is a more advanced fix and should be used carefully, especially if the package is system-critical.
Method 6: Fix Repository Issues
Broken or outdated repositories are a major cause of package problems.
Check your sources list:
sudo nano /etc/apt/sources.list
Look for:
- Unsupported Ubuntu versions
- Third-party PPAs that no longer exist
- Duplicate entries
Remove a problematic PPA:
sudo add-apt-repository --remove ppa:ppa-name
Then run:
sudo apt update
Method 7: Use Synaptic Package Manager (GUI Option)
If you prefer a graphical approach:
sudo apt install synaptic
Open Synaptic → Edit → Fix Broken Packages → Apply changes.
This is especially useful for beginners who want a visual overview of dependencies.
Method 8: Force Reinstallation of Packages
Sometimes reinstalling fixes version mismatches.
sudo apt install --reinstall package-name
For multiple packages:
sudo apt install --reinstall $(dpkg -l | awk '/^ii/ {print $2}')
Preventing Broken Packages in the Future
To avoid running into this issue again:
- Don’t interrupt
aptordpkgcommands - Avoid mixing packages from different Ubuntu releases
- Be cautious with third-party PPAs
- Update your system regularly:
sudo apt update && sudo apt upgrade - Use
aptinstead ofdpkgunless necessary
Final Thoughts
Knowing How to Fix Broken Packages in Ubuntu is an essential skill for anyone using Linux seriously. While package errors can look intimidating at first, they’re usually logical, traceable, and solvable with the right commands.
Start with simple fixes, understand what each command does, and avoid panic. Ubuntu’s package management system is powerful—and forgiving—when used correctly.
If you handle updates carefully and keep your repositories clean, broken packages will become a rare problem rather than a regular headache.
You can refer to the official Ubuntu package index, for the detailed reference.
FAQs: How to Fix Broken Packages in Ubuntu
What does “broken packages” mean in Ubuntu?
Broken packages in Ubuntu usually mean that one or more installed programs have missing, incompatible, or unresolved dependencies. This often happens when an installation or update is interrupted, when incompatible repositories are added, or when multiple versions of the same software conflict with each other. As a result, Ubuntu’s package manager refuses to continue until the issue is fixed.
Is it safe to fix broken packages in Ubuntu?
Yes, fixing broken packages is generally safe when you use recommended commands like apt --fix-broken install or dpkg --configure -a. These tools are designed to repair package issues without harming your system. Problems usually arise only when system-critical packages are forcefully removed without understanding their dependencies.
Why do broken packages occur after an update?
Broken packages after an update usually occur due to:
- Interrupted updates (power failure, system reboot)
- Poor internet connectivity during downloads
- Conflicting third-party repositories or PPAs
- Mismatched package versions across repositories
Even a single failed package can stop the entire update process.
What is the first command I should try to fix broken packages?
The first command you should always try is:
sudo apt --fix-broken install
This command allows Ubuntu to automatically resolve dependency issues and complete unfinished installations. In many cases, this alone fixes the problem.
What should I do if dpkg was interrupted error appears?
If you see this error, it means package configuration was left incomplete. Run the following command:
sudo dpkg --configure -a
This completes pending configurations and often removes the blockage preventing further installations or upgrades.
Can broken packages stop software from installing?
Yes. When broken packages exist, Ubuntu locks the package manager to prevent further damage. Until the issue is fixed, you won’t be able to install, remove, or upgrade software using APT or the Software Center.
What are held packages, and why do they cause issues?
Held packages are packages that Ubuntu is instructed not to upgrade. While useful in specific scenarios, held packages can block dependency resolution during system updates. If not managed carefully, they can cause broken package errors and version conflicts.
Is it okay to remove a broken package forcefully?
Force-removing a package should be a last resort. While it can fix severe dependency loops, removing system-critical packages can break essential functionality. Always try automated fixes first and understand what a package does before removing it manually.
Do broken packages mean my Ubuntu system is corrupted?
No. Broken packages do not mean your entire system is corrupted. They only affect package management. In most cases, your system is fully recoverable without reinstalling Ubuntu.
When should I consider reinstalling Ubuntu?
Reinstalling Ubuntu should only be considered if:
- Core system packages are severely damaged
- Multiple fixes fail repeatedly
- The system fails to boot properly
For most package issues, reinstalling is unnecessary.
Can third-party PPAs cause broken packages?
Yes. Third-party PPAs are one of the most common causes of broken packages. They may:
- Stop receiving updates
- Provide incompatible versions
- Conflict with official Ubuntu repositories
Always remove unused or outdated PPAs if package errors occur.
How can I prevent broken packages in the future?
To prevent broken packages:
- Avoid interrupting updates
- Use stable repositories
- Limit unnecessary PPAs
- Update your system regularly
- Avoid mixing packages from different Ubuntu versions
Good package hygiene significantly reduces future issues.
Does fixing broken packages delete my data?
No. Fixing broken packages does not affect your personal files or data. It only repairs software installations. However, removing specific applications may delete their configuration files.
Can I fix broken packages without using the terminal?
Yes. Tools like Synaptic Package Manager provide a graphical way to fix broken packages. However, the terminal remains faster and more reliable for advanced troubleshooting.
Why does Ubuntu sometimes fail to fix broken packages automatically?
Automatic fixes fail when:
- Dependencies conflict across repositories
- A package version is unavailable
- A required repository no longer exists
In such cases, manual intervention is required to identify and remove the problematic package or repository.

Fix E: Unable to Locate Package Error on Ubuntu: 11 Simple Ways