When I try to install a package or anything, I get the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ____

How do I resolve this to install my packages?

  • What package are you trying to install? Are you sure it's in the repositories? You've done an apt update or apt-get update?
    – Xen2050
    Mar 2, 2019 at 12:44
  • Any package...i tryed apt update and apt-get update...nothing Mar 2, 2019 at 15:03
  • You can't just install any package in existence, only the ones in your repos are available. And what was the output from an update, did it actually update anything or gave errors? This command should list all packages, available and "[installed]": apt search ".*"
    – Xen2050
    Mar 2, 2019 at 17:01
  • Can you provide a list of packages that you are attempting to install?
    – oxr463
    Jul 30, 2019 at 12:34

3 Answers 3


Solved Unable to Locate Package Issue

  1. Enter the command: leafpad /etc/apt/sources.list
  2. Remove everything within that sources.list file
  3. Google for "Kali Linux Repository" or use this link: Kali Linux Repository
  4. Scroll down and look for "The kali-rolling repository"
  5. Copy everything within that kali-rolling and paste on sources.list file
  6. Save the sources.list file
  7. Run the command: apt-get update
  8. Now install ur package(e.g:apt-get install tor)
  • 1
    This worked for me, finally after trying other options. Thanks Ajay
    – TWhite
    Oct 30, 2019 at 3:22

You may have an issue with your /etc/apt/sources.list file which is where the apt command looks for the installation of new packages. According to the Kali official docs:

The single most common causes of a broken Kali Linux installation are following unofficial advice, and particularly arbitrarily populating the system’s sources.list file with unofficial repositories.

You can try making a backup of your current sources.list file then creating a new one with the "default" source entry. You'll need to run these as root/with sudo:

# cp /etc/apt/sources.list /etc/apt/sources.list.backup


# echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" > /etc/apt/sources.list

Now try running sudo apt update. If that completes successfully, try installing your package again. See the link above for additional information that may be useful depending on your exact Kali release.

  • in update of linux 2019.4 open terminal and use given command: etc/apt/sources.list.d afterwards create a new document file and past the repositories in the mousepad.
  • deb http://http.kali.org/kali kali-rolling main non-free contrib deb-src http://http.kali.org/kali kali-rolling main non-free contrib deb http://http.kali.org/kali kali-rolling main non-free contrib

    after that use this command to update your kali linux repositories: sudo apt-get update

Not the answer you're looking for? Browse other questions tagged or ask your own question.