How to fix N: Unable to locate package package-name in APT
This error occurs when APT cannot find a package in its configured repositories. Common causes include outdated package cache, typos in the package name, missing repositories, or unsupported package versions.
Quick fix
Fixes N: Unable to locate package package-name
sudo apt update
sudo apt install package-name- Update the APT package cache
- Verify the exact package name
- Enable additional repositories
- Check and repair /etc/apt/sources.list
sudo apt updatesudo apt install package-nameN: Unable to locate package package-name
What this error means
The APT package manager searches its local cache of available packages when you run `apt install`. This error means the requested package name is not found in any of the configured repositories or in the local cache. This is typically not a critical system error—it simply means the package either doesn't exist, is named differently, is in a disabled repository, or isn't available for your system's architecture or distribution version.
Typical symptoms
- apt install command fails with 'N: Unable to locate package' message
- Package installation stops even though the software exists
- Works on one machine but not another with similar Ubuntu/Debian version
- Recently installed system cannot find common packages
Common causes
- Outdated APT package cache—the most common cause. Run after fresh install or when repositories have been updated.
- Typo or case sensitivity in package name—Linux package names are case-sensitive and may differ from software names (e.g., docker.io not docker).
- Package is in disabled repositories—universe, multiverse, or restricted repositories may be disabled by default.
- Package unavailable for your Ubuntu/Debian version—some packages are only available for specific versions or architectures.
- End-of-life distribution version—older release versions stop receiving package updates.
- Missing or commented-out repository lines in /etc/apt/sources.list—the sources file may not have active repositories.
- Network connectivity issues preventing access to remote repositories during apt update.
How to fix "N: Unable to locate package package-name"
Run sudo apt update to refresh the list of available packages from all configured repositories. This is the most common fix.
sudo apt update
sudo apt install package-nameThe update command rebuilds the local cache that APT searches when you run install.
Check the package name for typos and ensure correct capitalization. Search for the package using:
apt search keywordFor example, if you want Docker, search for:
apt search dockerYou'll see the exact package name is docker.io, not docker. This is critical—package names are case-sensitive and may differ from the software's common name.
Many packages are in the universe, multiverse, or restricted repositories that may be disabled. Enable them:
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo add-apt-repository restricted
sudo apt updateThen retry the install. On older systems, you may also need to enable the main repository.
Open the sources list file with:
sudo nano /etc/apt/sources.listLook for commented-out lines (starting with #) that contain active repositories. Uncomment them by removing the #:
# Before (commented out)
# deb http://deb.debian.org/debian bullseye main
# After (uncommented)
deb http://deb.debian.org/debian bullseye mainSave the file (Ctrl+O, Enter, Ctrl+X) and run sudo apt update again.
If none of the above steps work, the cache may be corrupted. Clear it with:
sudo apt clean
sudo apt update
sudo apt install package-nameThis removes all cached package files and rebuilds the cache from scratch.
If your distribution version has reached end-of-life, official repositories stop providing updates. Check:
hwe-support-status --verboseFor Debian, check the release schedule at https://wiki.debian.org/DebianReleases. If your version is unsupported, consider upgrading to a newer LTS (Long-Term Support) version.
If the package truly doesn't exist in your repositories, try these alternatives:
1. Use a Personal Package Archive (PPA) for Ubuntu:
sudo add-apt-repository ppa:author/ppa-name
sudo apt update
sudo apt install package-name2. Install from source code (usually requires development tools)
3. Use alternative package managers like snap or flatpak
4. Download pre-compiled binaries from the software's official website
Be cautious with PPAs—use only trusted sources, as they bypass Ubuntu's security review process.
Advanced notes
The APT cache is stored in /var/lib/apt/lists/. Each repository has a corresponding file containing available packages. When you run apt update, these files are downloaded from the repository servers. If a repository URL is outdated or the server is down, that repository's packages won't be cached. Use apt-cache search to query the local cache directly without network calls. For CI/CD environments (Docker, GitHub Actions), always run apt update before apt install since containers start with empty caches. On systems with strict network policies, you may need to configure APT to use a proxy server in /etc/apt/apt.conf.d/. The restricted repository contains proprietary drivers and software—some users intentionally disable it for freedom/licensing reasons.
Frequently asked questions
- What does "N: Unable to locate package package-name" mean?
- The APT package manager searches its local cache of available packages when you run apt install. This error means the requested package name is not found in any of the configured repositories or in the local cache. This is typically not a critical system error—it simply means the package either doesn't exist, is named differently, is in a disabled repository, or isn't available for your system's architecture or distribution version.
- How do I fix "N: Unable to locate package package-name"?
- This error occurs when APT cannot find a package in its configured repositories. Common causes include outdated package cache, typos in the package name, missing repositories, or unsupported package versions.
- What causes "N: Unable to locate package package-name"?
- Outdated APT package cache—the most common cause. Run after fresh install or when repositories have been updated. Typo or case sensitivity in package name—Linux package names are case-sensitive and may differ from software names (e.g., docker.io not docker). Package is in disabled repositories—universe, multiverse, or restricted repositories may be disabled by default.
- Is the "N: Unable to locate package package-name" error serious?
- It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- 📚APT Official Documentation
- 📝
- 📖
- 📝
- 📖Ubuntu - Ubuntu Packages Search(Official Docs)