LinuxMedium

Package Not Found in Linux: How to Fix Package Manager Errors

This article explains why the system can't find the requested package and provides practical solutions for major Linux distributions. You'll learn how to check repositories, update the cache, and manually add package sources.

Updated at February 15, 2026
10-15 min
Easy
FixPedia Team
Применимо к:Ubuntu 22.04+Debian 11+CentOS 7/8Fedora 35+Arch Linux

What the "Package not found" Error Means

The "Package not found" error (or its variants: E: Unable to locate package, No package <name> available., Error: Nothing provides <name>) is a message from your Linux distribution's package manager. It means the system did not detect the package you requested in any of the active and configured repositories.

The error appears when running installation commands such as:

sudo apt install nginx
sudo yum install httpd
sudo pacman -S vim

The system checks the local metadata cache (lists of available packages) and, if the specified name is not found, aborts the operation.

Causes

The error occurs not due to network or disk problems, but because of a mismatch between your request and the configuration of package sources. The main causes:

  1. Typo in the package name. The most common cause. Package names are case-sensitive and require exact spelling (e.g., postgresql vs postgresql-client).
  2. Outdated local cache. The system has not updated the list of available packages since the last installation. New packages in the repositories are unknown to it.
  3. Deactivated or missing repository. The package exists but is in a repository that is either not added to the configuration (sources.list) or is added but commented out (disabled).
  4. Package removed from repositories. The package is outdated, has been replaced, or moved to an archive (e.g., oldlibs in Debian).
  5. Repository GPG key problem. An invalid or missing security key can cause the package manager to ignore the entire repository.
  6. Architecture mismatch. The package is built for a different architecture (e.g., i386), and only amd64 is enabled on your system.
  7. Using an outdated package manager. For example, trying to install a package from the EPEL repository in CentOS 8, which switched to dnf and requires separate configuration.

💡 Tip: Before looking for complex causes, always first perform a cache update (sudo apt update and equivalents). This solves up to 50% of such problems.

Solutions

Method 1: Update Package Cache and Check Name

This is the basic and most effective diagnosis.

  1. Update metadata. Run the update command for your package manager.
    • Debian/Ubuntu (apt):
      sudo apt update
      
    • RHEL/CentOS 7 (yum):
      sudo yum makecache
      
    • RHEL/CentOS 8+/Fedora (dnf):
      sudo dnf makecache
      
    • Arch Linux (pacman):
      sudo pacman -Sy
      

    Pay attention to the command output. If you see errors like "Failed to fetch" or "Cannot retrieve repository metadata", there is a network connectivity or repository access problem.
  2. Search for the package by part of its name. Ensure the package name is entered correctly.
    apt search nginx  # For apt
    yum search nginx  # For yum/dnf
    pacman -Ss nginx  # For pacman
    

    The search results will show the exact package name and a brief description.
  3. Try installing again.
    sudo apt install nginx
    

Method 2: Check and Configure Repositories

If the cache update succeeded but the package is still not found, the issue is in the repository configuration.

  1. Find the configuration files.
    • apt (Debian/Ubuntu): The main file is /etc/apt/sources.list. Also check the /etc/apt/sources.list.d/ directory for separate .list files.
    • yum/dnf (RHEL/CentOS/Fedora): The directory /etc/yum.repos.d/. Files with the .repo extension.
    • pacman (Arch): The main file is /etc/pacman.conf. Also check /etc/pacman.d/mirrorlist for up-to-date mirrors.
  2. Ensure the needed repository is active. Open the file in a text editor (e.g., sudo nano /etc/apt/sources.list). Lines starting with # are commented out (inactive). Ensure the line with the repository containing your package does not have a # at the beginning.
    Example for Ubuntu (the universe repository should be uncommented):
    # deb http://archive.ubuntu.com/ubuntu/ jammy universe
    deb http://archive.ubuntu.com/ubuntu/ jammy universe restricted main multiverse
    
  3. For RHEL/CentOS/Fedora: Ensure in the .repo file, under the [repo_name] section, enabled=1 is set. If enabled=0, the repository is disabled.
  4. After making changes, run sudo apt update (or its equivalent) again and try the installation.

Method 3: Add the Missing Repository Manually

If you discovered the package is in a repository not present in your system (e.g., universe in Ubuntu, epel in CentOS), you need to add it.

  • Ubuntu/Debian (adding universe/multiverse):
    sudo add-apt-repository universe
    sudo add-apt-repository multiverse
    sudo apt update
    

    ⚠️ Important: The add-apt-repository command may be missing. Install it: sudo apt install software-properties-common.

  • CentOS 7 (adding EPEL):
    sudo yum install epel-release
    sudo yum update
    
  • CentOS 8+/Rocky/AlmaLinux (adding EPEL):
    sudo dnf install epel-release
    sudo dnf update
    
  • Fedora: Most repositories are active by default. For RPM Fusion (multimedia/non-free software):
    sudo dnf install rpmfusion-free-release rpmfusion-nonfree-release
    sudo dnf update
    
  • Arch Linux: Ensure the [core], [extra], and [community] repositories are uncommented in /etc/pacman.conf. For AUR (unofficial packages), you will need to use yay or paru.

Method 4: Check and Install GPG Keys

If during apt update you see errors like The following signatures couldn't be verified because the public key is not available: NO_PUBKEY <KEYID>, the package manager does not trust the repository.

  1. Import the missing key. Replace <KEYID> with the long hex identifier from the error.
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <KEYID>
    

    For yum/dnf, keys are usually located in /etc/pki/rpm-gpg/. They can be imported like this:
    sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-*
    
  2. Update the cache again. sudo apt update. The key errors should disappear.

Method 5: Install the Package Manually (Temporary Workaround)

If you need the package urgently and don't have time to configure a repository, you can download a .deb or .rpm file manually and install it. This is not recommended for system packages due to the lack of automatic updates and dependency resolution.

  • Debian/Ubuntu (.deb):
    # Download the file from the official website or repository
    wget http://ftp.us.debian.org/debian/pool/main/c/curl/curl_7.88.1-10_amd64.deb
    # Install it
    sudo dpkg -i curl_7.88.1-10_amd64.deb
    # If there are unresolved dependencies, run
    sudo apt --fix-broken install
    
  • RHEL/CentOS/Fedora (.rpm):
    wget https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/38/Everything/x86_64/os/Packages/c/curl-7.88.1-10.fc38.x86_64.rpm
    sudo rpm -i curl-7.88.1-10.fc38.x86_64.rpm
    # For automatic dependency resolution, use yum/dnf instead
    sudo yum localinstall curl-*.rpm
    # or
    sudo dnf install ./curl-*.rpm
    

Prevention

To avoid the "Package not found" error in the future:

  1. Regularly update your package cache. Add sudo apt update (or its equivalent) to your regular system update script.
  2. Search for a package before installing. Use apt search, yum search, or pacman -Ss to verify the exact name and availability.
  3. Do not disable standard repositories. The system base (main, core, extra) should always be active. Only disable unnecessary partner or third-party repositories.
  4. When adding third-party repositories (PPA, RPM Fusion), always import their GPG keys. This ensures your system will trust them.
  5. Use stable distributions. Rolling-release distributions (Arch) may temporarily lack a package due to building. In stable ones (Ubuntu LTS, Debian Stable), the package set is predictable.
  6. Check the architecture. If you are using a 64-bit system (amd64/x86_64), ensure you are searching for packages for that architecture. Some older packages may only be available for i386.

F.A.Q.

Why is the package available online but apt can't find it?
Can I install a package without a repository, just from a .deb or .rpm file?
The error occurs only for one specific package. What to do?
After adding the repository, the error persists. What else to check?

Hints

Identify the package manager and exact package name
Update repository metadata cache
Check repository availability and status
Install missing GPG keys (if required)
Try installing the package by specifying the repository (optional)
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community