How to fix sources.list file on Kali Linux

The sources.list file issue often appears after updating Kali Linux. Today's article will show you how to edit sources.list file on Kali Linux.

Fix the default repository

First, after installing a new Kali Linux completely, sources.list counte only the repository is

 123 ## Regular repositories 
deb http://http.kali.org/kali potassium main non-free contrib
deb http://security.kali.org/kali-security potassium / updates main contrib non-free

If you try, it can update some applications, but if you try to install a new application, it will not be possible to 90% and a message like this will appear:

 E: Unable to locate package 

How to fix sources.list file on Kali Linux Picture 1

The easiest way is to edit /etc/apt/sources.list

Remove or comment each line with # in front and add the following line in the terminal window:

 leafpad /etc/apt/sources.list 

After this command line, the screen will appear:

How to fix sources.list file on Kali Linux Picture 2

Now, remove the old command line and add a new one.

Repo for Kali Linux versions

  1. For Kali Linux 1.x users, use the repo below:

(Don't update Kali 1.0, upgrade to Kali 2016 instead).

 123456 ## Regular repositories 
deb http://http.kali.org/kali potassium main non-free contrib
deb http://security.kali.org/kali-security potassium / updates main contrib non-free
## Source repositories
deb-src http://http.kali.org/kali potassium main non-free contrib
deb-src http://security.kali.org/kali-security potassium / updates main contrib non-free
  1. For Kali Linux 2.0 - Kali Sana, use the repo below:

(You can still get updates for Kali Sana but not for long. So upgrade to Kali 2016.1)

 123456 # Regular repositories 
deb http://http.kali.org/kali sana main non-free contrib
deb http://security.kali.org/kali-security sana / updates main contrib non-free
# Source repositories
deb-src http://http.kali.org/kali sana main non-free contrib
deb-src http://security.kali.org/kali-security sana / updates main contrib non-free
  1. For Kali Linux 2016 - Kali Rolling, use the repo below:
 123deb http://http.kali.org/kali potassium-rolling main contrib non-free 
# For gói nguồn truy cập, uncomment theo sau dòng
# deb-src http://http.kali.org/kali potassium-main contrib non-free
  1. With Kali Linux 2017.1 sources.list use the following repo:
 1deb http://repo.kali.org/kali potassium-rolling main non-free contrib 

Finally, save and close the file.

Install new, update and upgrade your Kali installation

Use the following command:

 1apt-get clean && apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y 

Kali Rolling Repository

In contrast to dev-potassium, potassium-rolling is expected to be of better quality because it is managed by a tool that ensures the installation capability of all packages contained therein. This tool will select packages that are updated from the dev-command and copy them into potassium-rolling only if they have been verified to be installable.

If you still have any questions about updating, read the article How to update Kali Linux and fix errors when updating.

See more:

  1. How to scan websites for potential security vulnerabilities with Vega on Kali Linux
  2. How to install Kali Linux on Android using Linux Deploy
  3. Kali Linux commands from AZ and commonly used commands
4.1 ★ | 142 Vote

May be interested

  • How to install Kali Linux on macOSHow to install Kali Linux on macOS
    since the release of kali linux 1.0.8, kali linux supports efi. this additional feature simplifies the process of installing and running potassium on various apple macbook air, pro and retina models.
  • How to Install Kali Linux NetHunter on AndroidHow to Install Kali Linux NetHunter on Android
    kali linux is the most popular security and penetration testing operating system in the world. thanks to the nethunter project, you can now install kali linux on your android phone.
  • How to install Kali Linux reduced versionHow to install Kali Linux reduced version
    kali mini iso or kali linux's shortened version is a convenient way to install a minimal potassium system and install it 'from scratch'.
  • Team Kali Linux teaches free online pentest on TwitchTeam Kali Linux teaches free online pentest on Twitch
    offensive security, the creators of kali linux, has just announced that they will host a free penetration testing (pentest) course with kali linux.
  • How to install Kali Linux dual boot on macOSHow to install Kali Linux dual boot on macOS
    since the release of kali linux 1.0.8, kali linux supports adding efi. this additional feature simplifies the process of installing and running potassium on various apple macbook air, pro and retina models. modeling the device will determine the level of success when users experience with newer devices. refind preinstallation can also increase the success rate on older devices. this tutorial will show you dual osx booting with kali linux using refind and encryption options
  • Learn about Ethical hacking using Kali Linux and Raspberry PiLearn about Ethical hacking using Kali Linux and Raspberry Pi
    a raspberry pi 3 runs kali linux for building amazing hacking skills. this small computer is cheap, powerful and very flexible.
  • How to install Kali Linux running Dual Boot with WindowsHow to install Kali Linux running Dual Boot with Windows
    instructions detail how to install kali linux running in parallel with windows operating system. tips to install kali linux dual boot with windows, simple and fastest
  • How to encrypt LVM partitions when installing Kali LinuxHow to encrypt LVM partitions when installing Kali Linux
    sometimes, we have sensitive data and want to encrypt using the entire drive encryption. with kali installer, you can start installing lvm partition encryption on both the hard drive or usb drive. the installation procedure is very similar to the normal kali linux installation, except to choose an encrypted lvm partition during installation.
  • How to conduct IoT pentest with Kali LinuxHow to conduct IoT pentest with Kali Linux
    kali linux can be used to perform many pentest tests on computers in combination with other related techniques. the following are the penetration testing platforms and methods for iot devices related to kali linux.
  • Learn Forensics Mode in Kali LinuxLearn Forensics Mode in Kali Linux
    kali linux 'live' provides users with 'forensic mode', a feature introduced for the first time in backtrack linux.