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:

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

  1. Anonymous says:

    thanks for help

  2. Catamaranman says:

    1000x Thanks!

  3. Deucalion says:

    This solution works for me.Thank!!

  4. pvsvpw says:

    thanks. it working, i have searched a lot in internet but only found this one helpful

  5. Anonymous says:

    wasted 11 hours for searching this

    Thanks a lot

  6. B phani kumar says:

    Hit:1 kali-rolling InRelease         
    Err:2 unstable InRelease   
      502  Connection timed out [IP: 80]
    Reading package lists… Done
    W: Failed to fetch  502  Connection timed out [IP: 80]
    W: Some index files failed to download. They have been ignored, or old ones used instead.


Leave a Reply

Your email address will not be published.