Ubuntu is a user-friendly Linux distro well-known for its stability and vast software catalog. However, even the most seasoned Ubuntu users are likely to encounter the “E: Unable to locate package” error. This error message usually appears when you are trying to install a package via APT.

We’ll show you how you can fix the “E: Unable to locate package” error message on Ubuntu. Whether you are a novice or a seasoned admin, knowing how to overcome this error will greatly enhance your ability to use Ubuntu.

searching for the flameshot software on ubuntu

1. Update Your Package List

Updating your package list is important for maintaining a secure, functional, and up-to-date Ubuntu system. Most importantly, it ensures you get the best possible software experience while keeping your system safe and stable.

You can update your package list by running:

Occasionally, or whenever you want to install a new piece of software, make sure that you run the preceding command. By updating the package list, you ensure that you have access to the latest versions of software packages, along with any newly added packages.

Other benefits of running thesudo apt updatecommand include access to new security patches, bug fixes, and better dependency resolution.

command to get ubuntu release name

2. Use the Correct Package Name

Unlike Windows, Linux is inherently case-sensitive when it comes to file and directory naming. This means that uppercase and lowercase letters are treated distinctly. For example, the files “Test.txt”, “TEST.txt” and “TesT.txt” are all distinct files on Linux.

The same principle applies to package names. Make sure that you spell the package name correctly. Even a slight typo such as an uppercase letter where there should be a lowercase will result in the “E: Unable to locate package” error.

apt show command on ubuntu

If you are not sure of the package name you can use the apt command to search for partial package names. For example, let’s assume that you are looking for thepopular screenshot software Flameshot, but you only remember that it begins with flame. Well, you can search for it using the partial name as follows:

3. Verify Repository Information

APT will only install software from a given set of configured repositories on your system. This is good for security because you can limit your system to get software from only a few trusted sources.

By default,Ubuntu comes with some default repositoriesconfigured for you. But occasionally, you might need to add a repository to gain access to software that isn’t part of your current configured repositories.

Take a look at your configured repositories using:

Your sources list should normally have the following repositories configured and active by default. Active repositories are not commented out with the # character.

release-namein the preceding snippet will be replaced with your current Ubunturelease-name. You can get yourrelease-nameby runninglsb_release -cin the terminal. The codename outputted by this command is your currentrelease-name.

It is relatively easy toadd new software repositories on Linux. Also, most software installation guides will mention whether you need to add a new repository, so make sure you pay attention to that.

For security purposes, make sure that you are adding trusted and well-maintained PPAs and repositories to your system.

4. Check for Software Compatibility

In some cases, certain software packages may not be available on older versions of Ubuntu. In rare cases, some software packages can only be available on the LTS releases of Ubuntu. In such cases, you may experience the “E: Unable to locate package” error due to compatibility issues.

You can check for more information about a package by running:apt show package-name. For example, for the package flameshot, run:

Also, pay attention to compatibility information from the packages' official website to make sure that the software package you are trying to install is compatible with your Ubuntu version.

5. Other Fixes

If none of the preceding solutions have helped, try clearing your package cache and then update your package list again using:

You can also attempt to install a small package such as cowsay, using the commandsudo apt update && apt install cowsayjust to see if everything is fine.

You Can Now Fix the “E: Unable to Locate Package” Error on Ubuntu

As an Ubuntu user, you will most likely encounter the “E: Unable to locate package” error at some point. This error is solvable and equipped with the right information you can confidently face it head-on.

To ensure you don’t run into such errors again, always look out for broken packages on your PC.