How to fix E: Couldn't find any package by regex 'package-name' in APT

APTBEGINNERMEDIUMUpdated Dec 29, 2025· 223 views

The "Couldn't find any package by regex" error occurs when apt cannot locate a package because it doesn't exist in your repositories, the package name is misspelled, or you're using glob patterns incorrectly. Update your package lists, verify the exact package name, and ensure your repositories are properly configured to resolve this.

Quick fix

Fixes E: Couldn't find any package by regex 'package-name'

sudo apt update
  1. Update your package lists
  2. Verify the exact package name
  3. Check if the package exists in a third-party repository
  4. Verify your sources.list is correct
apt — error
sudo apt update
E: Couldn't find any package by regex 'package-name'

What this error means

This error appears when you attempt to install a package using apt and the package manager cannot find a match for the name you provided. apt searches through its cached package index (in /var/lib/apt/lists/) for any package matching the name or pattern you specified. If no packages match, apt reports this error. This can happen because the package doesn't exist, the name is misspelled, the package is only available in repositories you haven't configured, or the package name syntax is incorrect. When using wildcards or regex patterns, apt may also fail if the pattern doesn't match any actual package names in your repositories.

Typical symptoms

  • Error message appears when running apt install with a package name
  • Package cannot be found even though you're sure it exists
  • Using wildcards or glob patterns (e.g., "package-*") returns no matches
  • Installation fails with "package-name" not found in repository listing
  • Different systems report the same package as missing

Common causes

  1. Package does not exist or is not available in your configured repositories (most common)
  2. Package name is misspelled or uses incorrect syntax
  3. Required repository is not enabled or configured in sources.list
  4. Package lists have not been updated with apt update
  5. Using wildcard or regex patterns that don't match any available packages
  6. Repository does not provide the package for your Ubuntu/Debian version
  7. Package was removed or renamed in newer repository versions

How to fix "E: Couldn't find any package by regex 'package-name'"

1Update your package lists

First, refresh apt's local cache of available packages:

bash
sudo apt update

This downloads the latest package lists from all configured repositories. Without this, apt may be searching against outdated package information.

2Verify the exact package name

Search for the package to find its exact name in your repositories:

bash
apt search package-name

Replace "package-name" with what you're looking for. This shows all packages matching your search term. For example:

bash
apt search nodejs

Will show available Node.js related packages like "nodejs", "nodejs-dev", etc. Use the exact name shown in the search results.

3Check if the package exists in a third-party repository

If apt search doesn't find the package, it may be in a PPA or third-party repository. Add the necessary repository:

bash
sudo add-apt-repository ppa:username/ppa-name
sudo apt update

For official packages, check the repository's documentation for installation instructions. For example, some projects provide their own .deb repositories:

bash
sudo add-apt-repository "deb [arch=amd64] https://example.com/repo focal main"
sudo apt update

Then retry the installation with the correct package name.

4Verify your sources.list is correct

Check your repository configuration:

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

Ensure you have repository lines for your Ubuntu/Debian version. Common issues:

- Using repositories for wrong version (e.g., bionic sources on focal)
- Repositories are commented out (# at start of line)
- Non-existent or broken repository URLs

For Ubuntu, you can check your release version:

bash
lsb_release -cs

Standard Ubuntu repositories include main, universe, restricted, and multiverse. If you need a package, ensure the appropriate repository is enabled in sources.list.

5Install the package with correct name

Once you've found the correct package name, install it:

bash
sudo apt install package-name

For example:

bash
sudo apt install curl

If you're unsure about package naming, install without wildcards first. Using glob patterns like apt install package-* is generally not recommended—apt install expects exact package names or uses apt-file for searching packaged files (not package names).

Advanced notes

When using apt for automation scripts, always run apt update before attempting installations to ensure package lists are current. Note that apt install does not support regex patterns in the traditional sense—it matches exact package names only. If you need to find packages containing specific files, use apt-file search filename instead. For searching across all repositories without installing first, use apt-cache search pattern. Some packages may have architecture-specific suffixes (e.g., :amd64) or be restricted to certain Ubuntu releases, so verify compatibility before troubleshooting. Additionally, when setting up CI/CD pipelines or containers, consider using Debian/Ubuntu base images that include common packages, or pre-install frequently used packages in your Dockerfile to avoid repository lookup issues.

Frequently asked questions

What does "E: Couldn't find any package by regex 'package-name'" mean?
This error appears when you attempt to install a package using apt and the package manager cannot find a match for the name you provided. apt searches through its cached package index (in /var/lib/apt/lists/) for any package matching the name or pattern you specified. If no packages match, apt reports this error.
How do I fix "E: Couldn't find any package by regex 'package-name'"?
The "Couldn't find any package by regex" error occurs when apt cannot locate a package because it doesn't exist in your repositories, the package name is misspelled, or you're using glob patterns incorrectly. Update your package lists, verify the exact package name, and ensure your repositories are properly configured to resolve this.
What causes "E: Couldn't find any package by regex 'package-name'"?
Package does not exist or is not available in your configured repositories (most common) Package name is misspelled or uses incorrect syntax Required repository is not enabled or configured in sources.list
Is the "E: Couldn't find any package by regex '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