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:

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:
- Type the package name in the “keyword” field of the “Search package directories” section.
- Tick the check box for “Only show exact matches:” to enable it.
- Select the distribution’s codename according to your Ubuntu version. For instance, I’m using Ubuntu 24.04, so I selected the codename “noble”.
- Finally, click the “search” button to verify the availability/existence of the specified package.

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.

However, if you find some results, this means the specified package exists. In this particular scenario, you can employ/proceed with the following steps:
- Open “software & update” from the App menu.
- Navigate to the “Ubuntu Software” tab and make sure the following checkboxes are ticked/enabled:

Now update the packages list and try to install the desired package using the following commands:
sudo apt update
sudo apt install <package_name>
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:

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:
sudo apt search <packageName>

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:
sudo apt update

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:
hwe-support-status --verbose
The output shows that our Ubuntu version is active and supported until May 2029:

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):
# for adding the main repository sudo add-apt-repository main
# for adding the universe repository sudo add-apt-repository universe
# for adding a multiverse repository sudo add-apt-repository multiverse # for adding the restricted repository
sudo add-apt-repository restricted
Once the desired repository is added, don’t forget to update the system cache using the command below:
sudo apt update
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.