How to fix E: Unmet dependencies. Try using -f in APT
The "E: Unmet dependencies. Try using -f" error occurs when apt package dependencies are broken. The -f flag (or --fix-broken) tells apt to automatically install missing dependencies and resolve conflicts to repair your package system.
Quick fix
Fixes E: Unmet dependencies. Try using -f
sudo apt update- Update package lists
- Use -f flag to fix broken dependencies
- Check if the fix was successful
- Use -f with autoremove to clean up broken dependencies
sudo apt updateE: Unmet dependencies. Try using -f
What this error means
Unmet dependencies happen when the apt package manager detects that installed or installable packages have unsatisfied requirements. The error suggests using the -f flag as a quick automatic fix. This flag instructs apt to download and install any missing packages needed to satisfy dependencies, which typically resolves most broken dependency situations. Without the -f flag, apt refuses to perform the requested operation to prevent system corruption. The -f flag enables "fix-broken" mode, allowing apt to take corrective action. In some cases, apt may need to remove conflicting packages to resolve the issue.
Typical symptoms
- apt install/remove/upgrade commands fail with 'Unmet dependencies' message
- Cannot install new packages due to dependency conflicts
- System upgrades fail partway through
- Package manager shows warnings about broken packages
- Error message specifically suggests 'Try using -f'
Common causes
- Partial or interrupted package installation leaving broken state
- Conflicting versions between packages from different repositories
- Third-party PPAs (Personal Package Archives) with incompatible packages
- Manually removed packages without resolving dependent packages
- Packages held at specific versions that prevent dependency satisfaction
How to fix "E: Unmet dependencies. Try using -f"
First, refresh your package cache to ensure apt has the latest package information:
sudo apt updateThis synchronizes your local package index with the latest available packages in your repositories. Often, simply updating the cache can resolve dependency issues.
Run apt install with the -f flag to automatically fix broken dependencies:
sudo apt install -fOr using apt-get:
sudo apt-get install -fThe -f flag (short for --fix-broken) tells apt to:
- Identify missing packages required by other packages
- Download and install those missing packages
- Remove packages that cannot have their dependencies satisfied
This command requires no package names - apt automatically determines what needs to be fixed.
After running the above command, verify the system is healthy:
sudo apt checkIf this command completes without errors, your package system is repaired. Try your original operation again:
sudo apt install package-nameIf apt still shows issues, combine the fix with autoremove to eliminate unused packages:
sudo apt install -f
sudo apt autoremoveThe autoremove command removes packages that were automatically installed as dependencies but are no longer needed. This often resolves lingering dependency conflicts.
If apt install -f doesn't work, dpkg (the lower-level package manager) may need to finish configuring partially-installed packages:
sudo dpkg --configure -a
sudo apt install -fThe -a flag tells dpkg to configure all unconfigured packages. Run this before apt install -f for best results.
If basic fixes fail, dist-upgrade (distribution upgrade) sometimes has better dependency resolution:
sudo apt-get dist-upgradeWarning: dist-upgrade may upgrade or downgrade packages. It's more aggressive than regular upgrade but sometimes necessary for complex dependency situations. Always review the changes it proposes before confirming.
Advanced notes
The -f flag is a shortcut for --fix-broken. Both do exactly the same thing. The single-letter flag is often preferred in scripts and commands for brevity.
If you're still having issues after using -f:
1. Check your APT sources: Third-party PPAs are frequently the culprit. Review '/etc/apt/sources.list' and '/etc/apt/sources.list.d/'. Consider disabling PPAs temporarily to see if they cause the issue.
2. Use apt --fix-missing instead: This variant is sometimes more conservative: sudo apt install --fix-missing.
3. Check held packages: Held packages (marked to not upgrade) can prevent dependency resolution. List them with apt-mark showhold. Remove holds if needed: sudo apt-mark unhold package-name.
4. Try aptitude: The aptitude package manager uses more sophisticated algorithms: sudo aptitude install -f. First install it: sudo apt install aptitude.
5. Last resort - identify and remove the conflicting package manually using apt-get check to see what's broken, then remove it with sudo apt remove package-name.
Frequently asked questions
- What does "E: Unmet dependencies. Try using -f" mean?
- Unmet dependencies happen when the apt package manager detects that installed or installable packages have unsatisfied requirements. The error suggests using the -f flag as a quick automatic fix. This flag instructs apt to download and install any missing packages needed to satisfy dependencies, which typically resolves most broken dependency situations.
- How do I fix "E: Unmet dependencies. Try using -f"?
- The "E: Unmet dependencies. Try using -f" error occurs when apt package dependencies are broken. The -f flag (or --fix-broken) tells apt to automatically install missing dependencies and resolve conflicts to repair your package system.
- What causes "E: Unmet dependencies. Try using -f"?
- Partial or interrupted package installation leaving broken state Conflicting versions between packages from different repositories Third-party PPAs (Personal Package Archives) with incompatible packages
- Is the "E: Unmet dependencies. Try using -f" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.
Official resources & further reading
- ๐APT Official Documentation
- ๐apt manual pages(Official Docs)
- ๐apt-get manual pages(Official Docs)