Skip to content

Q&A · Answered

How to fix broken package dependencies on Ubuntu

asked 9 months, 3 weeks ago 1700 views 1 answer
8

I'm getting "unmet dependencies" error when trying to install packages with apt. apt install -f doesn't work. How to fix this?

1 Answer

One accepted
9

Accepted answer

Not confirmed since it was written, 9 months, 3 weeks ago

Broken dependencies can be tricky. Here's a step-by-step solution:

Step 1: Update package lists

sudo apt update

Step 2: Try fixing broken packages

sudo apt --fix-broken install
sudo dpkg --configure -a

Step 3: Clean and reinstall

sudo apt clean
sudo apt autoclean
sudo apt autoremove

Step 4: Force remove problematic package

# Find the problematic package
sudo dpkg -l | grep -i broken
# Force remove it
sudo dpkg --remove --force-remove-reinstreq package-name

Your answer

Say what you tried, not only what worked — the next person needs the reasoning. Code goes in a fenced block.

Shown beside your answer and never checked, so it cannot be a name someone already has here.

No account needed to answer. Sign in instead and it carries your name and earns reputation.