How to fix E: Version 'x.x.x' for 'package-name' was not found in APT

APTBEGINNERMEDIUMUpdated Dec 29, 2025· 231 views

The "Version was not found" error occurs when you try to install a specific version of a package that is not available in any of your configured repositories. This happens because the exact version string does not match available versions, the version is too old or new, or the package is no longer maintained in your repositories.

Quick fix

Fixes E: Version 'x.x.x' for 'package-name' was not found

apt-cache policy package-name
  1. List all available versions for the package
  2. Copy the exact version string from apt-cache
  3. Update your package cache
  4. Check if the version exists for your distribution
apt — error
apt-cache policy package-name
E: Version 'x.x.x' for 'package-name' was not found

What this error means

This error appears when you use apt-get install with a specific version number (using the syntax `package=version`) but that exact version cannot be found in any of your configured repositories. The apt package manager searches through all enabled repositories for the specified version, and if it cannot locate it, the installation fails. This differs from the "Unable to locate package" error—the package exists, but the specific version you requested does not. Version format mismatches are common: the version string must match exactly what apt lists in its cache, including release names, epoch numbers, and build designations.

Typical symptoms

  • Error displays "E: Version 'x.x.x' for 'package-name' was not found" when using apt install
  • Cannot install a specific package version with syntax like sudo apt install package=1.2.3
  • Version appears in apt-cache policy output but installation fails with version not found error
  • Cannot downgrade or upgrade to a particular version of an application

Common causes

  1. Version format does not exactly match the repository version string (most common)
  2. The specified version is too old and has been removed from active repositories
  3. The specified version is not available for your Ubuntu/Debian distribution version
  4. The package repository does not maintain the requested version
  5. Package cache is outdated and does not include newly available versions
  6. Version is only available in a disabled or removed PPA or third-party repository

How to fix "E: Version 'x.x.x' for 'package-name' was not found"

1List all available versions for the package

First, check what versions are actually available in your repositories using apt-cache:

bash
apt-cache policy package-name

This command shows all available versions with their sources. For example, if you run this for Docker:

bash
apt-cache policy docker-ce

You will see output like:

bash
docker-ce:
  Installed: (none)
  Candidate: 5:24.0.6~3-0~ubuntu-focal
  Version table:
     5:24.0.6~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:24.0.5~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages

Notice the exact format including colons, tildes, and build numbers.

2Copy the exact version string from apt-cache

The version you install must match exactly what appears in the apt-cache output. Do not simplify or abbreviate the version number. For example:

Incorrect (will fail):

bash
sudo apt install docker-ce=18.03.0.ce

Correct:

bash
sudo apt install docker-ce=5:18.03.0~ce-0~ubuntu

Note the differences:
- Colons (epoch): 5:
- Tildes instead of dots: ~ce instead of .ce
- Build designation: -0~ubuntu

Always copy the complete version string from apt-cache policy output.

3Update your package cache

If you cannot find the version you need, your package cache may be outdated. Update it:

bash
sudo apt update

This command refreshes your local cache of available packages from all enabled repositories. Sometimes newly released versions or older versions are added back to repositories, and you need to update to see them.

4Check if the version exists for your distribution

Some versions may only be available for specific Ubuntu/Debian versions. Check your current distribution:

bash
lsb_release -a

Or more concisely:

bash
lsb_release -cs

When searching for packages online (e.g., at packages.ubuntu.com), make sure you select the correct distribution version. A version available for Ubuntu 20.04 (Focal) may not be available for Ubuntu 22.04 (Jammy).

5Re-enable or add repositories if needed

If the version you need is from a PPA or third-party repository that you removed or disabled:

bash
sudo add-apt-repository ppa:owner/ppa-name
sudo apt update
apt-cache policy package-name

Then install using the exact version from the new apt-cache output:

bash
sudo apt install package-name=x.x.x

You can also check what PPAs are enabled:

bash
add-apt-repository --list | grep ppa
6Install the package with the correct version

Once you have confirmed the exact version string from apt-cache policy, install it:

bash
sudo apt install package-name=exact.version.string

For example:

bash
sudo apt install nginx=1.18.0-6ubuntu14.4

The installation should succeed if the version string is exact. If it still fails, double-check the version string character-by-character against the apt-cache output.

Advanced notes

The version string format in Debian/Ubuntu follows the format [epoch:]upstream-version[-debian-revision]. The epoch (colon-prefixed number) is used when the upstream version numbering scheme changes. Tildes (~) have special meaning in version comparison—they sort earlier than the character they precede, so 1.0~rc1 sorts before 1.0. Some packages use epoch numbers extensively (like Docker with 5: prefix) to ensure proper version ordering. If you need a very old version no longer in main repositories, check Ubuntu security archives: http://security.ubuntu.com/ or http://archive.ubuntu.com/. You can also pin specific versions using /etc/apt/preferences to prevent automatic upgrades: sudo nano /etc/apt/preferences and add entries specifying package pins.

Frequently asked questions

What does "E: Version 'x.x.x' for 'package-name' was not found" mean?
This error appears when you use apt-get install with a specific version number (using the syntax package=version) but that exact version cannot be found in any of your configured repositories. The apt package manager searches through all enabled repositories for the specified version, and if it cannot locate it, the installation fails. This differs from the "Unable to locate package" error—the package exists, but the specific version you requested does not.
How do I fix "E: Version 'x.x.x' for 'package-name' was not found"?
The "Version was not found" error occurs when you try to install a specific version of a package that is not available in any of your configured repositories. This happens because the exact version string does not match available versions, the version is too old or new, or the package is no longer maintained in your repositories.
What causes "E: Version 'x.x.x' for 'package-name' was not found"?
Version format does not exactly match the repository version string (most common) The specified version is too old and has been removed from active repositories The specified version is not available for your Ubuntu/Debian distribution version
Is the "E: Version 'x.x.x' for 'package-name' was not found" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading