I will select focal (20.04LTS) from the list.
Step1.1 - Visit Ubuntu package archive site and select your Ubuntu distro version It will make sure, there is no issue related to package name, lower or uppercase and even versions.
To find out the correct name of your package, you can follow these simple steps.
How to find package in Ubuntu repository, if exact package name not known The name of Java package starts with " openjdk" in real. I am getting " unable to locate package java".
If I will assume and try to install it with the name "java", it won't work. I want to install Java (version 11) in my Ubuntu 20.04 and I am not aware of the package name. Not providing specific or complete package name with version.Lowercase or upper case issue in the package name.The package name is not correct or not known.These are the very common mistakes happen during package installation. Also If you are a newbie, keep in mind that Linux is case sensitive. I have no doubt about your intelligence, but typing error may happen with anyone. Sometimes I type the wrong package name while installing packages in my Ubuntu system. It may sound silly, but yes, I still do this mistake very frequently. 8 Conclusion Solution 1 - How to Fix "Unable to locate package in Ubuntu" error due to incorrect package name.6 Solution 6 - /etc/apt/sources.list is missing or corrupted.5 Solution 5 - Your Ubuntu or Debian distro reached the end of life.4 Solution 4 - "Unable to locate package" in Ubuntu official repository.3 Solution 3 - Update and build local repository cache.2 Solution 2 - Provide an absolute package (.deb) path, for offline package installation.1 Solution 1 - How to Fix "Unable to locate package in Ubuntu" error due to incorrect package name.Let's deep dive and find solution to these possible cause. /etc/apt/sources.list is missing or corrupted.Your Ubuntu or Debian distro reached the end of life.The package is not available for your Ubuntu version in the official repository.Forgot to update the repository, after a fresh Ubuntu installation.Not providing a full path to your downloaded.Providing a file name instead of the package name.The package name is incorrect or case sensitive problem.I will replicate these errors and then give you a solution for easy understanding.īelow mentioned are Possible Causes for most of the errors. This post specifies Ubuntu but the solutions also apply to other Debian distros -Īll the above-mentioned error may occur due to different scenarios. I am sure if you will follow this post step by step, You will be able to resolve the following errors. We will see all the related issues and solution individually. There may be many reasons to encounter this error like the incorrect package name, Absolute path, package not available in repo and more. When I started my Linux journey many years ago, I also got this error in Ubuntu. If you are getting an " Unable to locate package" error and want to resolve it. This post is for all Linux lovers and newbies.