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:

[email protected]:~$ 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
- Open
sources.list
file with the following command in Linux terminal
sudo nano /etc/apt/sources.list
If you don’t have nano or getting the issue of unable to locate package nano, here’s the fix for unable to locate package nano.
- 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…

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.
- 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!!!
hi sir it not working
What’s the matter or error?
thank you for the help
i really appreciate it
Welcome bro. Do you liked this solution?
Thanks bro. It really helped to get rid of this fucking error.
sir, still is coming, this error when , im trying to install ngrok or cacafire
Share me the screenshot
hi i am still having the same problem and i do all the step
Can you share your issue?
Hi! Its not working
At first i runned;
“`
sudo apt update (it worked)
“`
Then when i run;
“`
sudo apt install terminator (it displays)
Reading package lists…Done
Buliding dependency tree
Reading state information … Done
E: Unable to locate package terminator
“`
Try updating your system by
“`
sudo apt-get update -y && apt-get upgrade -y
“`
and then, try
“`
sudo apt-get install terminator
“`
I have been examinating out a few of your posts and i must say clever stuff. I will definitely bookmark your website.