Unable to Locate Package Error Message
Unable to Locate Package Error Message

Accidentally, I had removed the Kali Linux from my computer system. And when I reinstalled it I got an error Unable to Locate Package, I browsed over numerous blogs and sites around the web for the solutions and I got it by summing all the information collected from various sites. And I thought why not share this collected info to you.

While I was trying to install the gedit app in Kali Linux through this code:

sudo apt-get install gedit

I got an error:

Unable to Locate Package Error Message
Unable to Locate Package Error Message
codie@kali:~$ sudo apt install gedit
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package gedit

Solution for Unable to Locate Package in Linux

I have presented two solutions for you to fix the problem of E: “Unable to Locate Package” Error in Kali Linux

The solutions of “Unable to Locate Package” is categorized and explained below:

Update the apt installer

Copy the below code and update the apt installer:

sudo apt update

And simply install your package after being updated.

If this worked, Hooray!!!

If not… Here’s an amazing and guaranteed solution for you.

Add the URL in sources.list and update apt

  1. Open sources.list file with the following command in Linux terminal
sudo nano /etc/apt/sources.list
  1. Paste the below repository code at the top sources.list
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb http://http.kali.org/kali kali-last-snapshot main non-free contrib
deb http://http.kali.org/kali kali-experimental main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib

Add more repositories

Update sources.list to Fix Unable to Locate Package
Update sources.list to Solve Unable to Locate Package

It should look something as below:

GNU nano 4.9.2 /etc/apt/sources.list
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb http://http.kali.org/kali kali-last-snapshot main non-free contrib
deb http://http.kali.org/kali kali-experimental main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib
#deb cdrom:[Kali GNU/Linux 2020.2rc3 Kali-last-snapshot - Official amd64 DVD Binary-1 with fi>
#deb cdrom:[Kali GNU/Linux 2020.2rc3 Kali-last-snapshot - Official amd64 DVD Binary-1 with fir>
#This system was installed using small removable media
(e.g. netinst, live or single CD). The matching "deb cdrom"
entries were disabled at the end of the installation process.
#For information about how to configure apt package sources,
see the sources.list(5) manual.
  1. Update apt

Update the apt which this command:

sudo apt update

Solved!!! Now, you should try to reinstall the package again.

Hope it helped you…

Thanks… Happy Linuxing!!!

Last modified: July 13, 2020

Author

5 2 votes
Article Rating
Subscribe
Notify of
guest
5 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
ninja

hi sir it not working

Bishwas Bhandari

What’s the matter or error?

jack

thank you for the help
i really appreciate  it

Bishwas Bhandari

Welcome bro. Do you liked this solution?

Jamir Joshep

Thanks bro. It really helped to get rid of this fucking error.