This used to be my major challenge when i first started the journey on Ethical hacking and penetration testing so i have a feeling a whole lot of beginners face similar challenge. It’s a minor problem that occurs when your Kali Linux repository ‘sources.list‘ file is empty for some weird reason or having files that are not supposed to be there in the. first place.
Your terminal will throw up an error similar to the one in the screenshot below when you try to either update or install new program. Here is how to fix that easily.
Open a terminal window and follow the below instructions:
Step 1: Type the code below in a terminal
sudo nano /etc/apt/sources.list
Step 2: Navigate with the down arrow key on your keyboard to the bottom of the page and type in the official Kali Linux repository source.list address.
deb http://http.kali.org/kali kali-rolling main non-free contrib
Step 3: Press “Ctrl + X” key on your keyboard to exit. Press “Y” key for yes, and “Enter” key to confirm. (Note: the Ctrl key you should use is the one on the left side of your keyboard)
Step 4: Now test that you can now update and install programs.
Alright, that’s all for fixing apt-get not working in Kali Linux.
As usual, if you have any queries, ask them in the comments and I’ll get back to you ASAP. Also, do drop a comment if this post worked for you.