How to fix Depends: package-name but it is not going to be installed in APT
APT cannot resolve package dependencies because required packages are unavailable, have version conflicts, or are held. This typically occurs with conflicting PPAs, version mismatches, or incompatible repositories.
Quick fix
Fixes Depends: package-name but it is not going to be installed
sudo apt --fix-broken install- Run apt fix-broken install to auto-resolve dependencies
- Identify the conflicting package
- Check held packages
- Disable conflicting PPAs
sudo apt --fix-broken installDepends: package-name but it is not going to be installed
What this error means
This error means APT's dependency resolver has detected that a package you're trying to install depends on another package that either: 1. **Doesn't exist** in your configured repositories 2. **Has a version conflict** with another installed package 3. **Is held** (marked as do-not-upgrade) 4. **Conflicts with** other packages that would be installed APT is informing you that it cannot complete the installation because the dependency chain is broken. The "not going to be installed" part indicates that APT has given up trying to automatically resolve this particular dependency.
Typical symptoms
- apt install command fails with unmet dependencies message
- apt update succeeds but apt install fails
- Error messages showing package name followed by "but it is not going to be installed"
- Cannot upgrade or install new packages
- Works fine until after adding a new PPA or repository
Common causes
- Conflicting PPAs or additional repositories that provide incompatible package versions
- Version mismatch between a required dependency and what is available in your repositories
- Attempting to install packages from wrong distribution version (e.g., Ubuntu 22.04 packages on 20.04)
- A package is held (marked as do-not-upgrade) which blocks dependent packages
- Repository contains broken packages or incomplete dependency information
- System disk space or RAM is insufficient for dependency resolution
How to fix "Depends: package-name but it is not going to be installed"
Run this command to let APT attempt automatic dependency resolution:
sudo apt --fix-broken installIf that doesn't work, also try reconfiguring packages:
sudo dpkg --configure -aThis forces the package manager to verify all package relationships.
From the error message, identify which package cannot be installed. For example:
Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.3 is to be installedThe conflicting package is libc6 with a version mismatch. Note the exact package name and version requirement.
Some packages may be held (marked to not upgrade). List held packages:
apt-mark showholdIf a held package is causing the conflict, you can unhold it:
sudo apt-mark unhold package-nameThen try the install again.
If the error started after adding a PPA, disable it:
Using GUI (Ubuntu Desktop):
- Open "Software & Updates"
- Go to "Other Software" tab
- Find and uncheck the problematic PPA
Using command line:
sudo add-apt-repository --remove ppa:username/ppaname
sudo apt-get updateAfter removing the PPA, try installing again.
aptitude has better conflict resolution than apt. Install it:
sudo apt-get install aptitudeThen try installing your package with aptitude:
sudo aptitude install package-nameAptitude will often find solutions that apt cannot. If it offers alternative packages, review and accept them.
Ensure you are installing packages for your distribution. Check your Ubuntu/Debian version:
lsb_release -aor
cat /etc/os-releaseMake sure any packages or PPAs you add are compatible with your version. For example, don't install Ubuntu 22.04 packages on a 20.04 system.
Advanced notes
Understanding Version Pinning: When a package specifies "Depends: libname (= exact.version)", it requires an exact version match. If your system has a different version installed, the dependency cannot be satisfied without downgrading or upgrading that library.
PPA Conflicts: PPAs (Personal Package Archives) often contain newer or different versions of packages than official repositories. Having multiple conflicting PPAs can cause version conflicts that APT cannot resolve. It's best to keep PPA use minimal and from trusted sources.
Rootless/Container Environments: In Docker containers or restricted environments, dependency resolution may fail differently. Ensure the base image has the correct repositories configured.
Repository Priority: If you have multiple repositories providing the same package, APT may select versions in unexpected ways. Use apt-cache policy package-name to see which version APT prefers and from which repository.
Frequently asked questions
- What does "Depends: package-name but it is not going to be installed" mean?
- This error means APT's dependency resolver has detected that a package you're trying to install depends on another package that either: 1. Doesn't exist in your configured repositories 2. Has a version conflict with another installed package 3.
- How do I fix "Depends: package-name but it is not going to be installed"?
- APT cannot resolve package dependencies because required packages are unavailable, have version conflicts, or are held. This typically occurs with conflicting PPAs, version mismatches, or incompatible repositories.
- What causes "Depends: package-name but it is not going to be installed"?
- Conflicting PPAs or additional repositories that provide incompatible package versions Version mismatch between a required dependency and what is available in your repositories Attempting to install packages from wrong distribution version (e.g., Ubuntu 22.04 packages on 20.04)
- Is the "Depends: package-name but it is not going to be installed" 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
- ๐
- ๐
- ๐