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 https://http.kali.org/kali 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 https://http.kali.org/kali kali-rolling main non-free contrib # deb-src https://http.kali.org/kali 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 https://http.kali.org/kali kali-rolling main contrib non-free" || cat /etc/apt/sources.list | grep -E "deb https://http.kali.org/kali 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’.
If you have problems, then start by creating a backup:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bac
The following command will restore Kali Linux repository to original state (note that ALL third-party repositories will be removed and only the official source of the packages will be written):
echo 'deb https://http.kali.org/kali kali-rolling main contrib non-free' | sudo tee /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 update
Continue reading:
Related articles:
- Alfa AWUS052NH – Kali Linux Compatible USB Adapter (100%)
- Best Kali Linux Compatible USB Wi-Fi adapters 2018 (100%)
- How to lookup MAC-address to find device manufacturer in Kali Linux (100%)
- How to increase TX-Power of Wi-Fi adapters in Kali Linux (100%)
- How to update Kali Linux (100%)
- Kali Linux web server shows blank pages (SOLVED) (RANDOM - 100%)
thanks for help
1000x Thanks!
This solution works for me.Thank!!
thanks. it working, i have searched a lot in internet but only found this one helpful
wasted 11 hours for searching this
Thanks a lot
Hit:1 https://mirror.karneval.cz/pub/linux/kali kali-rolling InRelease
Err:2 http://deb.i2p2.no unstable InRelease
502 Connection timed out [IP: 193.150.121.69 80]
Reading package lists… Done
W: Failed to fetch http://deb.i2p2.no/dists/unstable/InRelease 502 Connection timed out [IP: 193.150.121.69 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
Errors in Kali Linux ‘W: Failed to fetch’ and ‘W: Some index files failed to download. They have been ignored, or old ones used instead.’ (SOLVED)
when i try and do
└─$ echo -e "deb https://http.kali.org/kali kali-rolling main contrib non-free" > /etc/apt/sources.list
it it tells me permision denied
Hello! Thank you for your report. I fixed the error.
thank you soo much dear .
it works .