How to check / restore Kali Linux Rolling Repository

It is highly recommended to keep Kali Linux Repository in original state. You and your Kali can avoid a lot of problems if you will not populate the system’s sources.list file with unofficial repositories.

Indeed, Kali needs only one line in the /etc/apt/sources.list file:

deb kali-rolling main non-free contrib

You can open the file manually

sudo gedit /etc/apt/sources.list

Likely you'll see the default strings:

deb kali-rolling main non-free contrib
# deb-src kali-rolling main non-free contrib

Also you can use the complex command to test Kali Repository:

if cat /etc/apt/sources.list | grep -E "deb kali-rolling main contrib non-free" || cat /etc/apt/sources.list | grep -E "deb kali-rolling main non-free contrib"; then echo -e "\n\n\033[0;32mRepository is ok"; else echo -e "\n\n\033[0;31mRepository is not alright"; fi

If Kali Linux Repository have no necessary string, you’ll see message ‘Repository is not alright’.

You can restore Kali Linux Repository to original state by the command

echo -e "deb kali-rolling main contrib non-free" > /etc/apt/sources.list

Once you change the system’s sources.list file you should update information about available packages in the repositories:

sudo apt-get update

Continue reading:

Last Updated on

Recommended for you:

2 Comments to How to check / restore Kali Linux Rolling Repository

  1. Anonymous says:

    thanks for help

  2. Catamaranman says:

    1000x Thanks!

Leave a Reply

Your email address will not be published.