• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Fix: “E: Unable to Locate Package” Error in Linux

By Abhishek Ghosh May 18, 2024 11:32 am Updated on May 18, 2024

Fix: “E: Unable to Locate Package” Error in Linux

Advertisement

Encountering the “E: Unable to Locate Package” error message in a Linux terminal can be frustrating, especially when trying to install software or dependencies specially in Ubuntu. This error indicates that the package manager, such as apt (or may be yum), cannot find the requested package in its repositories. In this comprehensive guide, we’ll explore the possible causes of this error and provide step-by-step solutions to resolve it. Usually the error looks like this:

Vim
1
2
3
4
5
$ sudo apt-get install <package>
Reading package lists... Done
Building dependency tree      
Reading state information... Done
E: Unable to locate package <package>

Obviously, your internet connection must be working.

 

Understanding the Error

 

The “E: Unable to Locate Package” error typically occurs when the package manager cannot find the specified package in its list of available packages. This can happen due to various reasons, including:

Advertisement

---

  • Typographical errors in the package name.
  • The package repository is not enabled or properly configured.
  • The package has been removed from the repository.
  • The package name has changed, or it belongs to a different repository.

 

Troubleshooting Steps

 

Check for Typos

Verify that you’ve entered the correct package name without any spelling mistakes. Even a minor typo can result in the package manager being unable to locate the package.

For example, if you wrongly type mariabd instead of mariadb, even apt-search will return nothing:

Vim
1
2
apt-search mariabd
apt-search mariadb

You may find the correct package-name (i.e. the name in the repository) using apt-cache search command too.

Fix E Unable to Locate Package Error in Linux

May be, you have to update the index:

Vim
1
sudo apt-file update

Update Package Lists

Sometimes, the package lists stored by the package manager may be outdated. Run the following command to update the package lists before attempting to install the package:

Vim
1
2
sudo apt update # for APT
sudo yum makecache # for YUM

Ensure Repository is Enabled

Ensure that the repository containing the package is enabled in your system’s repository configuration. Check the /etc/apt/sources.list file (for APT) or repository configuration files in /etc/yum.repos.d/ (for YUM) to verify the repository settings. For example:

Vim
1
2
cat /etc/apt/sources.list
cat /etc/yum.repos.d/

Search for the Package

If you’re unsure about the correct package name or repository, you can use the package manager’s search functionality to find the package:

Vim
1
2
apt search # for APT
yum search # for YUM

Verify Repository URLs

If you’re using custom repositories or third-party repositories, ensure that the repository URLs are correctly configured. Incorrect URLs or repository configurations can prevent the package manager from locating the package.

To enable all repositories (main, universe, restricted, multiverse), use the following commands:

Vim
1
2
3
4
sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository restricted
sudo add-apt-repository multiverse  

Check for Package Availability

Verify that the package you’re trying to install is still available in the repository. Sometimes, packages are removed or renamed, leading to the “Unable to Locate Package” error. If a missing or outdated GPG key is causing the error, you can attempt to retrieve it:

Vim
1
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com key_id

Replace The key_id with the real value. Then you can add PPA (Ubuntu):

Vim
1
2
sudo add-apt-repository ppa:<repository-name>
sudo apt-get update

Clear Package Cache

In some cases, the package manager’s cache may be corrupted, causing issues with package installation. Clear the package cache and update the package lists:

Vim
1
2
sudo apt clean # for APT
sudo yum clean all # for YUM

 

Conclusion

 

The “E: Unable to Locate Package” error in Linux can be resolved by following the troubleshooting steps outlined above. By checking for typos, updating package lists, ensuring repository configuration, and verifying package availability, you can effectively troubleshoot and resolve this error. Remember to always double-check package names and repository settings to avoid encountering this error in the future. With the right approach, installing packages on Linux can be a smooth and hassle-free experience.

Tagged With wealthu8m
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Fix: “E: Unable to Locate Package” Error in Linux

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • PHP Snippet to Hide AdSense Unit on WordPress 404 Page

    Here is Easy PHP Snippet to Hide AdSense Unit on WordPress 404 Page to Avoid Policy Violation and Decrease False Impression, False Low CTR.

  • What is Package Manager?

    Package Manager or Package Management System allows a convenient management of software, which exists in packet form on Linux or UNIX Like operating system.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

vpsdime

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Cloud-Powered Play: How Streaming Tech is Reshaping Online GamesSeptember 3, 2025
  • How to Use Transcribed Texts for MarketingAugust 14, 2025
  • nRF7002 DK vs ESP32 – A Technical Comparison for Wireless IoT DesignJune 18, 2025
  • Principles of Non-Invasive Blood Glucose Measurement By Near Infrared (NIR)June 11, 2025
  • Continuous Non-Invasive Blood Glucose Measurements: Present Situation (May 2025)May 23, 2025
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2026 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy