How to Fix ‘E: Unable to locate package’ in Ubuntu

Attempting to install software on an Ubuntu desktop or server using the Advanced Package Tool (APT)—such as sudo apt install <package-name>—only to receive the terminal error: “E: Unable to locate package <package-name>” halts system configuration. The installation aborts immediately without downloading any binaries. This error indicates that the local APT cache does not contain a record of the requested package in its indexed repositories. This breakdown occurs when the local package lists are outdated, when required repository components (such as Universe or Multiverse) are disabled, when the package name contains typographical or architectural discrepancies, or when third-party Personal Package Archives (PPAs) have not been configured. This tutorial explains how to resolve package resolution failures in Ubuntu.

Why Does Ubuntu Throw the Unable to Locate Package Error?

APT operates by querying local database files stored in /var/lib/apt/lists/, which reflect package manifests downloaded from remote Ubuntu mirrors. Common triggers include:

  • Outdated Local APT Cache: Running apt install on a newly deployed system before running apt update to fetch the repository index.
  • Disabled Universe or Multiverse Repositories: Community-maintained software (such as ffmpeg, vlc, or htop) residing in repository components disabled by default on minimal or server installations.
  • Typos or Deprecated Package Names: Package names changing across Ubuntu LTS releases (e.g., python-pip becoming python3-pip, or libssl1.1 becoming libssl3).
  • Software Exclusively Distributed via Snaps or PPAs: Modern utilities distributed outside standard Debian repositories (such as certbot, neovim nightly, or proprietary drivers).
  • Architecture Mismatches: Packages built exclusively for amd64 failing to resolve on arm64 (e.g., Raspberry Pi or AWS Graviton) instances.

Step 1: Update the Local APT Package Index

On fresh Ubuntu installations, containers, or VPS instances, the local package index is empty until explicitly synchronized with Ubuntu mirrors.

  1. Open your terminal and run the update command:
    sudo apt update
  2. Wait for APT to query all configured mirrors. The output should display “Reading package lists… Done” without fatal errors.
  3. Once the index is updated, retry your installation command:
    sudo apt install <package-name>
  4. If the package is part of the standard repositories, installation will proceed immediately.

Step 2: Enable Universe, Multiverse, and Restricted Repositories

Many popular utilities and libraries belong to the community-maintained Universe or proprietary Multiverse repositories.

  1. Enable the Universe repository:
    sudo add-apt-repository universe
  2. Enable the Multiverse repository (for proprietary drivers and media codecs):
    sudo add-apt-repository multiverse
  3. Enable the Restricted repository:
    sudo add-apt-repository restricted
  4. Modern Ubuntu versions automatically refresh the package cache after adding a repository. If running an older release, run sudo apt update manually.
  5. Attempt to install your package again.

Step 3: Search for the Exact Package Name and Architecture

If you suspect the package name differs from what you typed, use APT search tools to identify the exact binary string.

  1. Search the indexed repositories using apt-cache:
    apt-cache search <keyword>
  2. For example, if looking for the Python MySQL connector:
    apt-cache search mysql | grep -i python
  3. Verify that the package is compatible with your CPU architecture (e.g., amd64 vs arm64):
    dpkg --print-architecture
  4. If you require a 32-bit package on a 64-bit multiarch system, add the 32-bit architecture identifier:
    sudo dpkg --add-architecture i386
    sudo apt update

Step 4: Add Missing PPAs or Official Vendor Repositories

If the package is not part of standard Ubuntu distribution repositories, you must add the software developer’s official repository.

  1. For software distributed via Launchpad PPAs (e.g., Git, OBS, or Node.js):
    sudo add-apt-repository ppa:<maintainer>/<ppa-name>
    sudo apt update
    sudo apt install <package-name>
  2. For third-party enterprise packages (such as Docker, NodeSource, or Google Chrome), import their official GPG keyring into /etc/apt/keyrings/ and add their source list to /etc/apt/sources.list.d/.
  3. Alternatively, check whether the software is available as an official Snap package:
    snap find <package-name>
    sudo snap install <package-name>

Troubleshooting Summary for APT Unable to Locate Package Error

Troubleshooting Step Command / Action Underlying Resolution
Index Refresh sudo apt update Synchronizes local /var/lib/apt/lists with remote Ubuntu mirrors
Repository Expansion sudo add-apt-repository universe multiverse Unlocks thousands of community and proprietary packages
Exact Name Query apt-cache search <term> Finds revised package names across Ubuntu distribution versions
Vendor Repositories Add PPA or check snap find Provides access to third-party tools absent from main distribution lists

By keeping APT package caches updated and ensuring the Universe repository component is enabled, you eliminate the “Unable to locate package” error and install required software seamlessly in Ubuntu.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.