How to fix E: Cannot install 'package-name', since it was not found in the apt cache in APT
This error occurs when apt cannot locate a package in its local cache of available packages. The cache stores metadata about packages from your configured repositories and must be up-to-date for apt to find and install packages.
Quick fix
Fixes E: Cannot install 'package-name', since it was not found in the apt cache
sudo apt update
sudo apt install package-name- Update the apt package cache
- Verify the package name is correct
- Clear and rebuild the cache
- Check your system date and time
sudo apt updatesudo apt install package-nameE: Cannot install 'package-name', since it was not found in the apt cache
What this error means
The apt package manager works by maintaining a local cache of package metadata from configured repositories. When you run `apt install`, apt searches this cache for the package. If the package isn't in the cache, apt cannot proceed with installation. This typically happens when the cache is outdated, corrupted, or when the package doesn't exist in your configured repositories. The error indicates a mismatch between what you're trying to install and what apt knows about.
Typical symptoms
- apt install commands fail with 'not found in the apt cache' error
- Package appears to exist in repository but cannot be installed
- Newly released packages cannot be found
- Specific package versions are not available
Common causes
- Package cache has not been refreshed (most common)
- Cache is corrupted or contains stale metadata
- Package doesn't exist in your configured repositories
- Package name is incorrect or misspelled
- Package is only available in disabled or unconfigured repositories
- System date/time is incorrect, causing repository signature validation failures
How to fix "E: Cannot install 'package-name', since it was not found in the apt cache"
Run sudo apt update to refresh the local cache with the latest package metadata from your repositories. This is the most common fix:
sudo apt update
sudo apt install package-nameThe apt update command fetches the latest package lists from your configured sources without installing or upgrading anything.
Check that you have the correct package name. Package names are case-sensitive and may not match the application name:
apt-cache search package-nameThis searches the cache for packages matching your query. For example, Docker is installed via the package docker.io, not docker.
If the cache appears corrupted, clear it completely and rebuild it:
sudo apt clean
sudo rm -rf /var/lib/apt/lists/*
sudo apt update
sudo apt install package-nameThis removes all cached files and forces apt to download fresh package metadata from scratch.
apt is sensitive to time discrepancies. Verify your system clock is correct:
dateIf the date/time is wrong, update it:
timedatectl set-ntp trueIncorrect time can cause repository signature validation failures, preventing package discovery.
Some packages are in optional repositories (like 'universe' on Ubuntu). If the package is in a disabled repository, enable it:
sudo add-apt-repository universe
sudo apt update
sudo apt install package-nameCheck your /etc/apt/sources.list and /etc/apt/sources.list.d/ to see which repositories are enabled.
Ensure your configured repositories are correct and accessible:
cat /etc/apt/sources.list
ls /etc/apt/sources.list.d/If repository URLs are incorrect or servers are unreachable, packages won't be found. Check for typos in sources.list and verify your network connectivity.
Advanced notes
The apt cache is stored in /var/lib/apt/lists/ as gzip-compressed index files from each repository. When you run apt update, apt downloads and decompresses these files. If these files become corrupted (often due to interrupted downloads or filesystem issues), apt may fail to recognize available packages. In such cases, the sudo rm -rf /var/lib/apt/lists/* approach completely clears the cache and forces a fresh download. Additionally, on some systems with limited storage, the package cache can exceed available disk space, preventing updates. Check disk usage with df -h if updates fail. For systems using personal package archives (PPAs) via add-apt-repository, the PPA's GPG key might not be properly configured, causing signature verification failures and package discovery issues.
Frequently asked questions
- What does "E: Cannot install 'package-name', since it was not found in the apt ca" mean?
- The apt package manager works by maintaining a local cache of package metadata from configured repositories. When you run apt install, apt searches this cache for the package. If the package isn't in the cache, apt cannot proceed with installation.
- How do I fix "E: Cannot install 'package-name', since it was not found in the apt ca"?
- This error occurs when apt cannot locate a package in its local cache of available packages. The cache stores metadata about packages from your configured repositories and must be up-to-date for apt to find and install packages.
- What causes "E: Cannot install 'package-name', since it was not found in the apt ca"?
- Package cache has not been refreshed (most common) Cache is corrupted or contains stale metadata Package doesn't exist in your configured repositories
- Is the "E: Cannot install 'package-name', since it was not found in the apt ca" error serious?
- It is a medium-severity error โ more of a blocker than a risk. The steps above resolve it.