How to fix E: Unable to locate package in APT

APTBEGINNERMEDIUMUpdated Dec 29, 2025ยท 1,225 views

This error occurs when the apt package manager cannot find a package in your configured repositories. The package may have a typo, your package cache may be outdated, or required repositories may be disabled on your system.

Quick fix

Fixes E: Unable to locate package

sudo apt update
  1. Update the package cache first
  2. Verify the exact package name
  3. Check your APT sources list
  4. Enable the Universe and Multiverse repositories
apt โ€” error
sudo apt update
E: Unable to locate package

What this error means

The "E: Unable to locate package" error means that apt (Advanced Package Tool) cannot find the package you're trying to install in any of its configured repositories. This is one of the most common errors when installing software on Debian-based systems like Ubuntu, Debian, or Linux Mint. When you run `apt install package-name`, apt searches through its local package cache, which contains a database of all available packages from your configured repositories. If the package doesn't appear in this cache, apt reports it cannot be located. The root cause is usually one of four things: a typo in the package name, an outdated package cache that hasn't been synced with repositories, disabled repositories that contain the package, or the package genuinely not being available for your system.

Typical symptoms

  • Installation command fails with 'E: Unable to locate package' error
  • The package name looks correct but apt still can't find it
  • Works on another machine or distribution but not yours
  • Error appears immediately after installing or upgrading the OS
  • Specific packages are unavailable for your Ubuntu/Debian version

Common causes

  1. Typo or incorrect package name (case-sensitive on Linux)
  2. Package cache is outdated and needs refresh with apt update
  3. Required repository is disabled or not configured
  4. Package is not available for your specific OS version or release
  5. Using an end-of-life (EOL) distribution version
  6. Package only exists in Universe, Multiverse, or other non-default repos
  7. Running on a non-Debian-based distribution
  8. Temporary repository server downtime or connectivity issue

How to fix "E: Unable to locate package"

1Update the package cache first

Before trying to install anything, refresh apt's local package cache:

bash
sudo apt update

This command connects to your configured repositories and downloads the latest list of available packages. If you just installed Ubuntu or haven't run apt update in a while, this is usually the solution.

Important: You must use apt update (not apt upgrade). These are different:
- apt update - Downloads the latest package list from repos
- apt upgrade - Installs available updates for already-installed packages

After updating, try your installation again:

bash
sudo apt install package-name
2Verify the exact package name

Double-check the package name for typos. Linux is case-sensitive, so "Python" and "python" are different.

Search for the correct package name:

bash
apt search package-name

This will list all packages matching your search term. For example:

bash
# Wrong: trying to install 'docker'
$ apt search docker
# Shows: docker.io, docker-compose, etc.

# Correct:
sudo apt install docker.io

Common package name surprises:
- docker is actually docker.io on Ubuntu
- vscode is code when installed from apt
- nodejs is available as nodejs (with different versions like nodejs-14, nodejs-16)

Use apt search liberally to find the exact name.

3Check your APT sources list

View your configured repositories to ensure they're correct:

bash
cat /etc/apt/sources.list

Also check sources in the sources.list.d directory:

bash
ls /etc/apt/sources.list.d/
cat /etc/apt/sources.list.d/*.list

If you see many lines starting with #, they are disabled/commented out. For example:

bash
# deb http://archive.ubuntu.com/ubuntu focal main restricted

The # at the beginning disables this repository. Common reasons for disabled repos:
- System installer disabled them
- Old PPA (Personal Package Archive) that no longer exists
- Intentionally disabled repositories

Caution: Only edit if you know what you're doing. Broken repositories can cause other problems. A safer approach is to use:

bash
sudo add-apt-repository universe
sudo apt update
4Enable the Universe and Multiverse repositories

Some packages live in additional repositories that may not be enabled by default. Enable them with:

bash
# Enable Universe (community-maintained open source)
sudo add-apt-repository universe

# Enable Multiverse (restricted, proprietary software)
sudo add-apt-repository multiverse

# Refresh the package cache
sudo apt update

Then try installing again:

bash
sudo apt install package-name

Note: Recent Ubuntu versions (20.04+) usually have these pre-enabled. This matters more on older versions or fresh minimal installs.

5Check if the package is available for your OS version

Not all packages are available for every Ubuntu or Debian release. Check online or use a web tool:

Visit [Ubuntu Packages](https://packages.ubuntu.com/) or [Debian Packages](https://www.debian.org/distrib/packages) and search your package name.

First, identify your Ubuntu/Debian version:

bash
lsb_release -a
# or
cat /etc/os-release

Example output: Ubuntu 22.04 LTS (Jammy Jellyfish)

Then check the package site to see which versions have your package. If your version isn't listed, the package simply isn't available for you.

Workaround 1: Install from a newer/older version manually:

bash
# Add PPA for newer version (example: Python 3.11)
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11

Workaround 2: Upgrade your OS to a newer version that has the package.

Workaround 3: Build from source if the package source is available.

6Verify your OS is still supported

If you're running an end-of-life (EOL) Ubuntu or Debian version, repositories may have been archived and are no longer actively updated.

Check your Ubuntu version:

bash
lsb_release -a

Compare against [Ubuntu Release Cycle](https://wiki.ubuntu.com/Releases). Once a version reaches EOL, security updates stop and packages may be hard to find.

Solution: Upgrade to a supported LTS (Long Term Support) version:

bash
# Check if upgrade is available
sudo do-release-upgrade -c

# Perform the upgrade (if available)
sudo do-release-upgrade

LTS versions are stable and supported longer:
- Ubuntu 20.04 LTS - Supported until April 2030
- Ubuntu 22.04 LTS - Supported until April 2032

7Try alternative installation methods

If apt doesn't have the package, try Snap or Flatpak:

Using Snap (usually pre-installed on Ubuntu):

bash
snap install package-name

Using Flatpak (requires installation first):

bash
sudo apt install flatpak
flatpak install flathub package-name

From source (if source code is available):

bash
git clone https://github.com/user/repo.git
cd repo
./configure
make
sudo make install

From official website: Many projects (Docker, VSCode, etc.) provide .deb files directly on their download pages.

Advanced notes

Understanding APT's package database: When you run apt update, your system downloads Packages files from each repository's Release subdirectory and caches them locally in /var/lib/apt/lists/. If these files are corrupted, apt may not see packages correctly. You can force a clean rebuild:

bash
sudo rm -rf /var/lib/apt/lists/*
sudo apt update

Repository GPG keys: Some PPAs require you to import their GPG keys before they work:

bash
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYID
# or for newer systems:
curl -fsSL https://example.com/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/example.gpg

Checking package details: Learn more about a package before installing:

bash
apt show package-name      # Show package details
apt depends package-name   # Show dependencies
apt rdepends package-name  # Show reverse dependencies (what depends on this)

PPA issues: Personal Package Archives (PPAs) can be problematic if:
- The PPA is archived or no longer maintained
- The maintainer stopped building for your Ubuntu version
- The PPA causes conflicts with official packages

List your PPAs:

bash
sudo add-apt-repository --list

Remove a problematic PPA:

bash
sudo add-apt-repository --remove ppa:user/ppa-name

Partial upgrades and held packages: If you've held or downgraded a package, apt may have dependency issues:

bash
sudo apt --fix-broken install
sudo apt autoremove

Docker-specific note: Docker is a special case where the official package on Ubuntu is docker.io (not docker). This is due to legacy trademark/naming issues. Always use:

bash
sudo apt install docker.io

Frequently asked questions

What does "E: Unable to locate package" mean?
The "E: Unable to locate package" error means that apt (Advanced Package Tool) cannot find the package you're trying to install in any of its configured repositories. This is one of the most common errors when installing software on Debian-based systems like Ubuntu, Debian, or Linux Mint. When you run apt install package-name, apt searches through its local package cache, which contains a database of all available packages from your configured repositories.
How do I fix "E: Unable to locate package"?
This error occurs when the apt package manager cannot find a package in your configured repositories. The package may have a typo, your package cache may be outdated, or required repositories may be disabled on your system.
What causes "E: Unable to locate package"?
Typo or incorrect package name (case-sensitive on Linux) Package cache is outdated and needs refresh with apt update Required repository is disabled or not configured
Is the "E: Unable to locate package" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading