How to Fix “E: Unable to Locate Package package_name” Error on Ubuntu 24.04

Installing new packages and software is a day-to-day task of every Linux user or administrator. The most convenient way of doing this is using the “apt” command. However, things get tricky when a user encounters the “Unable to Locate Package” error while installing a particular software. To fix this error, you must understand/diagnose why this error occurs.

So, let’s read this guide to see why this error occurs in Ubuntu and how we can fix this without any hassles.

How to Fix “E: Unable to Locate Package package_name” Error on Ubuntu 24.04

The “unable to locate package” error in Ubuntu can occur due to various reasons and its solution depends on identifying the specific reason causing the issue. For example:

  • Reason 1: The Package Doesn’t Exist
  • Solution: Verify the Availability of the Package
  • Reason 2: Inappropriate Package Name
  • Solution: Verify the Package Spelling and Letter Case
  • Reason 3: Outdated Package List
  • Solution: Update Package List
  • Reason 4: Unsupported/Inactive Ubuntu Version
  • Solution: Use an Active Ubuntu Version
  • Reason 5: Missing Repository
  • Solution: Add the Required/Missing Repositories
  • Reason 6: Internet Issues
  • Solution: Stable Internet Connection

Reason 1: The Package Doesn’t Exist

One of the most common reasons for the “E: Unable to Locate Package package_name” error is the package you’re trying to install doesn’t exist:

Unable to Locate Package package_name

Solution: Verify the Availability of the Package

Check the availability of the package from the official Ubuntu packages page. For this purpose, click on the attached link and execute the following steps:

  1. Type the package name in the “keyword” field of the “Search package directories” section.
  2. Tick the check box for “Only show exact matches:” to enable it.
  3. Select the distribution’s codename according to your Ubuntu version. For instance, I’m using Ubuntu 24.04, so I selected the codename “noble”.
  4. Finally, click the “search” button to verify the availability/existence of the specified package.
Unable to Locate Package package_name

Upon clicking the “Search” button, if you get the result something like this; It means the specified package doesn’t exist in the official Ubuntu repository. In such situations, you must utilize an alternative installation method like snap, PPA, etc.

Unable to Locate Package package_name

However, if you find some results, this means the specified package exists. In this particular scenario, you can employ/proceed with the following steps:

  1. Open “software & update” from the App menu.
  2. Navigate to the “Ubuntu Software” tab and make sure the following checkboxes are ticked/enabled:
Unable to Locate Package package_name

Now update the packages list and try to install the desired package using the following commands:

Reason 2: Inappropriate Package Name

Spelling mistakes or inappropriate letter cases can also lead to the “unable to locate a package” error. For example, the following snippet shows the stated error occurred because of wrong case convention and inappropriate spellings:

Unable to Locate Package package_name

Solution: Verify the Package Spelling and Letter Case

Double-check the package name to avoid type mistakes. Also, if you’re not sure about the correct package name, simply run the following command to search for the appropriate package name:

Unable to Locate Package package_name

Reason 3: Outdated Package List

We often add different repositories to our sources. However, if we don’t update the packages list after adding new repositories, the outdated packages can lead us to this error.

Solution: Update Package List

To avoid this error, simply execute the given command before installing a new software/package:

Unable to Locate Package package_name

Reason 4: Unsupported/Inactive Ubuntu Version

There are two types of Ubuntu releases: “LTS” and “Interim”. The LTS release is maintained for five years while the interim release is maintained for nine months. When a Ubuntu version expires, it no longer receives updates, patches, or has access to the latest packages. Therefore, an unsupported Ubuntu version can cause the “E: Unable to Locate Package package_name” Error.

Solution: Use an Active Ubuntu Version

Execute the below-mentioned command from the terminal to check the status of your Ubuntu version:

The output shows that our Ubuntu version is active and supported until May 2029:

Unable to Locate Package package_name

Note: If you are using an older/expired Ubuntu version, then upgrade it to the latest release to avoid the stated error.

Reason 5: Missing Repository

Ubuntu provides four primary repositories (“main”, “universe”, “multiverse”, and “restricted”) to ensure access to a variety of open-source and third-party software. If you are using an old Ubuntu version that misses any of the mentioned repositories, then you may face the stated issue.

Solution: Add the Required/Missing Repositories

To fix this error, you need to add the missing repository by executing one of the following commands, (depending on the missing repository):

Once the desired repository is added, don’t forget to update the system cache using the command below:

After this, try to install the selected package/software. If the missing repository was causing the issue, then this time you shouldn’t encounter the stated issue, and the chosen software should install successfully.

Reason 6: Internet Issues

An unstable internet connection can cause the “unable to locate package” error on Ubuntu 24.04. This is because Ubuntu fetches packages from repositories and if your internet connection is slow or unstable, you may encounter the stated error.

Solution: Stable Internet Connection

Ensure that your internet connection is stable and properly working. Also, check the proxy settings and configure them correctly to avoid this error.

Final Thoughts

In Ubuntu 24.04, the “unable to locate package” error occurs due to several reasons such as “the package does not exist”, “an inappropriate package name”, “an outdated package list”, “an unsupported Ubuntu version”, “a missing repository”, or “internet issues”.

You can resolve this error by applying solutions such as “verifying the availability of the package before installation” or “specifying the correct package name”. Additionally, “updating the package list before installing a new package”, “using an active/supported Ubuntu version”, “adding missing repositories”, or “fixing internet issues” can also help resolve the issue.

Scroll to Top