CIP Cyber

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

Table of Contents

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.

CIP Cyber Staff

CIP Cyber Staff

CIP Cyber Staff comprises CIP cybersecurity experts committed to delivering comprehensive information on critical infrastructure protection. The content covers diverse topics, equipping professionals to defend organizations and communities in an ever-evolving cyber landscape.

Most popular

Industrial Cybersecurity

Want always be up to date?

Don't miss the latest news

By subscribing to our mailing list, you will be enrolled to receive our new trainings, latest blog posts, product news, and more.

CIP Training & Certifications

Transform your cybersecurity skills with CIP Cyber’s comprehensive training & course offerings

Related Articles

Want always be up to date?

Don't miss the latest news

By subscribing to our mailing list, you will be enrolled to receive our new trainings, latest blog posts, product news, and more.

CIP Training & Certifications

Transform your cybersecurity skills with CIP Cyber’s comprehensive training & course offerings