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

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

Understand Encryption, Hashing, Encoding, and Obfuscation

You are mistaken if you believe Encryption, Hashing, Encoding, and Obfuscation are similar terms! Despite their apparent similarity, they are all opposed. This article...

Hacking & Cracking Windows Password by Just a PDF File

Passwords are always our first and, in cases, sole line of protection from attackers. If an intruder does not possess direct accessibility to a...

Port Forwarding via Meterpreter for Attacking Metasploitable 3

In this tutorial, we will learn how to do port forwarding in order to execute commands remotely on a target machine. Port forwarding is useful...

Are The Latest Developments In Online Gaming Crippling The Bingo Industry?

Introduction Bingo’s rich and extensive history stretches across almost five hundred years in different forms. Over the past decades, more and more people have moved...