This error occurs when apt cannot find or install a required dependency. It typically happens due to missing repositories, version conflicts, held packages, or PPA issues. Fixing it involves updating your package lists, resolving conflicts, and sometimes removing problematic sources.
When you run an apt command to install a package, apt performs dependency resolution—it checks what other packages (dependencies) are required for your installation to work. If apt cannot locate a specific required dependency in any of your configured repositories, or if the available version of that dependency doesn't satisfy the requirement, it displays this error. The "not installable" message means apt searched all enabled repositories and either couldn't find that package at all, or found versions that conflict with other installed packages or dependency constraints. This is common when using third-party PPAs (Personal Package Archives), when repositories become outdated, or when your system has held packages that prevent dependency resolution.
Start by refreshing apt's package cache to ensure you have the latest package information from all configured repositories.
sudo apt updateThis command downloads the latest package metadata from all your configured sources. Missing packages often appear because your cache is outdated.
Apt has a built-in feature to fix broken dependencies. This is the quickest solution for most cases.
sudo apt install -fOr use the older syntax:
sudo apt-get --fix-broken installThis command attempts to correct a system with broken dependencies by automatically selecting package versions that satisfy constraints. It's non-destructive—it only removes packages if absolutely necessary.
Sometimes packages are manually marked as "held" (prevented from upgrade/change). These can block dependency resolution.
sudo apt-mark showholdIf you see any packages listed, unhold them:
sudo apt-mark unhold package-nameThen retry your original apt command. Holding is useful for preventing unwanted upgrades, but can create dependency conflicts.
Third-party repositories (PPAs) are a common source of dependency issues. Check what you have enabled:
sudo add-apt-repository --listIf you see PPAs that are outdated, for different Ubuntu versions, or no longer needed, remove them:
sudo add-apt-repository --remove ppa:username/ppa-nameAfter removing a PPA, update your package lists:
sudo apt updatePPAs are often built for specific Ubuntu releases. Using a PPA for Ubuntu 20.04 on Ubuntu 22.04, for example, can cause exactly this error.
Aptitude is a higher-level package manager that's smarter at resolving complex dependency conflicts. It can suggest alternative solutions.
sudo apt install aptitudeThen try installing your package with aptitude instead of apt:
sudo aptitude install package-nameAptitude will present multiple solutions if conflicts exist, allowing you to choose the best approach. This is more powerful than apt for tricky situations.
Sometimes cached package information becomes corrupted. Clear it completely:
sudo apt clean
sudo apt autocleanThen update again:
sudo apt updateAfter cleaning, the next apt update will re-download all package metadata, which can resolve indexing issues.
Understanding Dependency Resolution: APT uses a sophisticated dependency solver. When you request a package, it must find versions of all dependencies that are compatible with each other AND with already-installed packages. This forms a "dependency graph." If no valid combination exists in your repositories, apt reports packages as "not installable."
PPA Best Practices: Always check a PPA's documentation to ensure it supports your Ubuntu version. PPAs built for Ubuntu 20.04 often won't work on 22.04 because of library version differences. Before adding a PPA, verify the supported versions.
Emergency Downgrade: If a recent upgrade broke dependencies, you can downgrade a specific package:
sudo apt install package-name=versionUse apt search package-name to find available versions.
Using apt with -o Debug: For deeper troubleshooting, see apt's reasoning:
sudo apt -o Debug::pkgProblemResolver=yes dist-upgradeThis shows apt's decision process when resolving conflicts.
E: Could not connect to proxy server
Could not connect to proxy server
E: Package 'package:i386' has no installation candidate
How to fix "Package package:i386 has no installation candidate" in apt
E: The value 'value' is invalid for APT::Default-Release
How to fix invalid APT::Default-Release value in APT
dpkg: error: unable to create new file 'path': Permission denied
How to fix dpkg permission denied errors in APT
subprocess installed post-removal script returned error exit status 1
How to fix "subprocess installed post-removal script returned error exit status 1" in APT