How to fix E: Cannot install 'package-name', since it was not found in the apt cache in APT

APTINTERMEDIATEMEDIUMUpdated Dec 29, 2025ยท 177 views

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
  1. Update the apt package cache
  2. Verify the package name is correct
  3. Clear and rebuild the cache
  4. Check your system date and time
apt โ€” error
sudo apt update
sudo apt install package-name
E: 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

  1. Package cache has not been refreshed (most common)
  2. Cache is corrupted or contains stale metadata
  3. Package doesn't exist in your configured repositories
  4. Package name is incorrect or misspelled
  5. Package is only available in disabled or unconfigured repositories
  6. 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"

1Update the apt package cache

Run sudo apt update to refresh the local cache with the latest package metadata from your repositories. This is the most common fix:

bash
sudo apt update
sudo apt install package-name

The apt update command fetches the latest package lists from your configured sources without installing or upgrading anything.

2Verify the package name is correct

Check that you have the correct package name. Package names are case-sensitive and may not match the application name:

bash
apt-cache search package-name

This searches the cache for packages matching your query. For example, Docker is installed via the package docker.io, not docker.

3Clear and rebuild the cache

If the cache appears corrupted, clear it completely and rebuild it:

bash
sudo apt clean
sudo rm -rf /var/lib/apt/lists/*
sudo apt update
sudo apt install package-name

This removes all cached files and forces apt to download fresh package metadata from scratch.

4Check your system date and time

apt is sensitive to time discrepancies. Verify your system clock is correct:

bash
date

If the date/time is wrong, update it:

bash
timedatectl set-ntp true

Incorrect time can cause repository signature validation failures, preventing package discovery.

5Enable additional repositories if needed

Some packages are in optional repositories (like 'universe' on Ubuntu). If the package is in a disabled repository, enable it:

bash
sudo add-apt-repository universe
sudo apt update
sudo apt install package-name

Check your /etc/apt/sources.list and /etc/apt/sources.list.d/ to see which repositories are enabled.

6Verify repositories are accessible

Ensure your configured repositories are correct and accessible:

bash
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.

Official resources & further reading