E: Unable to locate package means APT could not find the requested package in the package information available to it. Check the name and whether the repository indexes refreshed successfully before adding repositories.

This is different from Bash saying command not found. A command's name and the package that supplies it may differ; see our Bash command lookup guide if the error came from your shell.

Identify the Ubuntu environment

cat /etc/os-release
dpkg --print-architecture

Record the release and architecture. An instruction for another Ubuntu release may name a package that was renamed or removed. Software offered for amd64 is not automatically available for arm64. Do not change your configured release codename to match an old tutorial.

If you use several WSL distributions, open the intended Ubuntu distribution first. Installing in one environment does not install the software in the others.

Refresh the indexes and read the result

sudo apt update

This refreshes package information; it does not upgrade every installed package. Read the output for failures. APT can retain old indexes when an individual source fails, so a completed command alone is not proof that every configured source is healthy.

Update outputWhat to investigate
Temporary failure resolving a repository hostFollow the Ubuntu DNS checklist.
404 or missing Release fileCheck the repository address, configured suite and whether the provider supports your release.
Signature or certificate errorCheck system time and the repository provider's current trust configuration. Do not disable verification.
No space left on deviceDiagnose the affected filesystem before retrying.

Check the package name

Replace package-name with the exact package name from its Ubuntu package listing or the software publisher's instructions:

apt-cache search --names-only package-name
apt-cache policy package-name

Search results help find names; policy shows versions and the installation candidate for a known package. A candidate of (none) requires checking available versions and APT policy. That is not identical to a spelling error that produces no package record at all.

For a known package, an exact-name search can reduce noise:

apt-cache search --names-only '^bash$'

In the Ubuntu 24.04 test, this found Bash. A deliberately nonexistent package produced Unable to locate package and exit status 100 even after a successful index update. Repeating apt update cannot create a package that the sources do not contain.

Inspect configured repositories

Ubuntu installations can use both traditional .list files and deb822 .sources files. Read the files present in your environment:

ls /etc/apt/sources.list.d/
cat /etc/apt/sources.list.d/ubuntu.sources

The second path is common on newer Ubuntu installations; if it is absent, inspect the actual files listed instead and check whether /etc/apt/sources.list exists. In deb822 sources, examine URIs, Suites, Components, optional architecture restrictions and whether a stanza is disabled.

If the official package listing requires a repository component you have not enabled, follow Ubuntu's instructions for that component. If a third-party application requires its own repository, use its publisher's instructions for your exact release and architecture. Adding unrelated PPAs makes the source list harder to diagnose and can change package candidates.

If you downloaded a .deb file

A local filename is not the same thing as a repository package name. APT supports a local path such as ./example.deb. Follow our local .deb installation guide to inspect the file, simulate installation and verify the installed package.

After correcting the actual cause, retry installation and verify the package state. If the next error is an unsatisfied dependency, diagnose that dependency rather than treating it as the original lookup problem.

Sources and verification

Tested September 11, 2026 on Ubuntu 24.04 in a disposable container: index refresh, package-name search, candidate inspection, architecture and source inspection, and the nonexistent-package error. Repository migration, PPA installation and end-of-life upgrades were not performed.