How to fix E: Package 'package-name' has no available version, but exists in the database in APT
This error occurs when apt finds a package mentioned as a dependency but can't locate it in any enabled repository. Usually fixed by updating package lists, checking repository configuration, or fixing broken dependencies.
Quick fix
Fixes E: Package 'package-name' has no available version, but exists in the database
sudo apt update- Update your package lists
- Check the package with apt-cache
- Enable required repositories
- Fix broken dependencies
sudo apt updateE: Package 'package-name' has no available version, but exists in the database
What this error means
This error happens when the apt package manager knows a package exists (because another package depends on it or it's in the local cache), but it cannot find any installable version of that package in your currently enabled repositories. The package might have been removed from repositories you're using, exist only in disabled repositories, or be a virtual package that doesn't have an actual implementation available. APT maintains metadata about packages even after they're no longer available, which is why it knows about them but can't install them.
Typical symptoms
- apt install or apt update fails with the 'no available version' error message
- Dependencies cannot be resolved during installation attempts
- Error appears when trying to install a specific package or its dependencies
- Running apt install -f shows the same error for unmet dependencies
Common causes
- Your package lists are outdated and don't reflect current repository contents
- A required repository is disabled or has been removed from your sources.list
- The package only exists in a disabled repository (like universe or multiverse on Ubuntu)
- You're using a package mirror or PPA that no longer hosts the package
- The package is a transitional or virtual package without a real implementation
- Your system has mixed packages from incompatible Ubuntu/Debian versions
How to fix "E: Package 'package-name' has no available version, but exists in the database"
The most common cause is stale package metadata. Update apt's cache to reflect current repository contents:
sudo apt updateTry your installation again after updating. If you're still seeing the error, proceed to the next step.
Use apt-cache to get detailed information about the package:
apt-cache show package-name
apt-cache policy package-nameThis shows which repositories know about the package and what versions are available. If output is empty, the package doesn't exist in any enabled repository.
On Ubuntu systems, some packages live in disabled repositories. Enable them based on your needs:
# Enable universe repository
sudo add-apt-repository universe
# Enable multiverse repository (for restricted software)
sudo add-apt-repository multiverse
# Then update
sudo apt updateOn Debian, check if your sources.list needs additional entries for backports or testing versions.
If the error appears as part of broken dependency chains, use apt's built-in repair:
sudo apt --fix-broken installOr alternatively:
sudo apt install -fThis attempts to automatically resolve dependency conflicts by removing or installing packages as needed.
A corrupted cache can cause this issue. Clear it and rebuild:
sudo apt clean
sudo apt autoclean
sudo apt updateIf this still doesn't work, do a deeper cache rebuild:
sudo rm -r /var/lib/apt/lists/*
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt updateBe careful with the second method—ensure you include the wildcard at the end.
If your system has partially installed or corrupted packages, reconfigure dpkg:
sudo dpkg --configure -aThis attempts to configure any packages that were unpacked but not fully installed, which sometimes resolves dependency database corruption.
Advanced notes
If you're seeing this error with a package that appears in multiple Ubuntu/Debian versions, you may have mixed version packages on your system. Check your sources.list and PPAs for conflicting version specifications. You can use 'apt-cache search package-name' to find alternative packages or newer package names if the one you're looking for has been renamed or superseded.
For PPA packages, the error often indicates the PPA doesn't support your current Ubuntu version. Check the PPA maintainer's documentation or search for alternatives for your specific Ubuntu release.
If using Docker or other containerized environments, ensure your base image's repository sources are compatible with the packages you're trying to install.
Frequently asked questions
- What does "E: Package 'package-name' has no available version, but exists in the" mean?
- This error happens when the apt package manager knows a package exists (because another package depends on it or it's in the local cache), but it cannot find any installable version of that package in your currently enabled repositories. The package might have been removed from repositories you're using, exist only in disabled repositories, or be a virtual package that doesn't have an actual implementation available. APT maintains metadata about packages even after they're no longer available, which is why it knows about them but can't install them.
- How do I fix "E: Package 'package-name' has no available version, but exists in the"?
- This error occurs when apt finds a package mentioned as a dependency but can't locate it in any enabled repository. Usually fixed by updating package lists, checking repository configuration, or fixing broken dependencies.
- What causes "E: Package 'package-name' has no available version, but exists in the"?
- Your package lists are outdated and don't reflect current repository contents A required repository is disabled or has been removed from your sources.list The package only exists in a disabled repository (like universe or multiverse on Ubuntu)
- Is the "E: Package 'package-name' has no available version, but exists in the" error serious?
- It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- 📚APT Official Documentation
- 📖Debian Handbook: The apt-cache Command(Official Docs)
- 📖Ubuntu Manpage: apt-get(Official Docs)
- 🐙
- 📝