How to Fix Repository Error “Unable to Locate Package” in Kali Linux?

So you may notice that after installing Kali Linux whenever you try to install some new packages and use apt-get install command there was an error “ E : Unable to Locate Package” and the command is not working. This error occurs generally due to the repository error i.e. “sources.list” file is either blank or is setup with a dead repository.

Repository Error

To fix this error follow these steps:

Open sources.list file by command: #atom /etc/apt/sources.list 

Sources List

Here you need to remove the entry as this causes a broken Kali Linux installation. Apt uses this file /etc/apt/sources.list that lists the ‘sources’ from which packages can be obtained. This file is need to be edited with some either CLI editor or text editor.

Go to the address https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/

Here there are two repositories that you need to edit.

First copy the sources repositories

Sources Repositories

Then copy regular repositories

Regular Repositories

Paste these two entires in source.list file and save it

Paste on Souece ListExit the editor

Go to terminal and update the packages with the command: #apt-get update

apt-get update

Now try to install any package

apt-get install leafpad

The error has been fixed successfully and now any package can be installed easily.

Ehacking Staff
With more than 50 global partners, we are proud to count the world’s leading cybersecurity training provider. EH Academy is the brainchild of Ehacking, which has been involved in the field of training since the past Five years and continues to help in creating professional IT experts.

Most Popular

Security Against Hacks: A Simple Game of Economics

One of the cold hard truths behind cybersecurity is that it's impossible to prevent a hack 100% of the time. It only takes one...

Certain Things That You Must Know About Microsoft MS-500 Exam and Its Practice Tests

If you want to be a Microsoft 365 security administrator, then there would be a number of responsibilities that will fall on your shoulders,...

Quick Ways to Avoid Being Watched by the NSA’s PRISM Program

Big brother is on the watch online. Today, a week hardly passes without news of government spying, whistleblowers, cell phone hacking, or even private photos...

Android Post Exploitation: Exploit ADB using Ghost Framework in Kali Linux

This article is the part of Android Hacking tutorial; it covers step by step guide to exploit Android ADB to get the persistent connection...

LOOKING FOR HACKING RECIPES FORM THE PRO?

Then sign up for FREE to the ehacking’s exclusive group. You will get the exclusive tips/tricks, tutorials, webinars & courses that I ONLY share with my fellow on this exclusive newsletter.