Updated February 15, 2023
Introduction to Kali Linux Sources List
Kali Linux Sources list will give a go through of the package files and the package database files kept in the system. After installation of the Kali Linux ISO file, the user might need to update the Kali Linux repository sources list file with the official repository list manually. In this article, we shall see the Kali Linux sources list, and how to add Kali Linux repositories to the sources list. It is used to locate archives of the package distribution systems on the system.
The concept of it is not a thing of Kali Linux Operating system domain only but is applicable to all Linux Operating systems. Hence, when user wants to install the application on Kali Linux, they need to first consider the viability of the file. Even when the user wants to upgrade the existing application on Kali Linux, the file becomes key factor.
All Linux operating system activities that are related to application installations, system updates, upgrades and all refer to the sources list file. In such cases, it lets users know where to find system updates, application upgrades, and downloads, etc. On installing Kali Linux from the ISO file, the user may need to update the APT sources list file with the official repository list manually.
Key Takeaways
- It is found on /etc/apt/sources, and all the package files and database files are kept.
- The package manager helps in downloading package metadata, information about packages available, and where they can be downloaded.
- Clean Kali Linux OS has its sources list file prepopulated with repository information.
- Installation needs to be done under stable network access for the default repository entry that is to be generated.
- To add the custom repository to the sources list file, open the sources list file and add VirtualBox repository in the file Save Close the file on adding the repository to the sources list.
- /etc/apt/source.list is the configuration file for the Linux Advance Packaging tool which holds URL and information useful for remote repositories where software applications and packages are installed. Similar for files inside /etc/apt/sources.list.
How to Add Kali Linux Sources List?
Here we shall see how to add Kali Linux APT repositories to the sources list. Software repositories are needed by APT to download packages and install them onto the computer.
Step 1: By using the below command, we get to know the operating system release details.
Command:
cat /etc/os-release
Output:
Step 2: Login to Linux as a root user and launch the terminal. Check the current list of APT repositories present in the system.
Step 3: If there are no APT repositories present, use the below code to add repositories.
Command:
sudo tee -a /etc/apt/sources.list<<EOF
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib
EOF
This command will add standard source repositories in /etc/apt/sources.list. To check if added, use the below command.
Command:
cat /etc/apt/sources.list
Step 4: Update the packages list with the below command.
Command:
sudo apt update
Output:
Step 5: The user can also perform a system update, which is completely optional.
Command:
sudo apt -y upgrade
Output:
With the reboot command, sudo systemctl reboot.
Kali Linux Sources Format
Repositories in Kali Linux are responsible for providing packages to users on Linux. Debian-based distributions and Ubuntu use sources.list file to have a record of all repositories available on the system. The sources list file contains repository details, having each and every uncommented line representing a separate repository. Each line in sources. list file follows a common format.
deb https://repository.url distro type
- Here the first field denotes the type of package that is provided by the repository. On Ubuntu and Debian, the user will find one of the below archives:
deb and deb-src
Hence, by default, Ubuntu will disable repositories that provide a deb-src package.
- The second field is reserved for the repository URL, it points to a server that helps to store package files along with the database.
- The third field denotes the release code name of the Version of Ubuntu Installation. User may find bionic, xenial, and focal in the case of Ubuntu OS, sid, or buster in the case of Debian.
- The fourth entry has information on the type of repository. In Ubuntu, the fourth field may contain any of the below-mentioned repository components:
restricted, main, multiverse, and universal.
For e.g., consider a segmented breakdown in the Kali Linux source list file entry.
deb http://kali.org/ kali-rolling main non-free contrib
<<Archive>> <<Mirror>> <<Branch>> <<Component>>
- Archive: Based on whether the user wants the package source or the package itself, the archive can be deb Regular Binary or deb-src Source.
- Mirror: It represents a load balancer and adheres to the format mentioned. It keeps a duplicate copy of update or package data that users want to download, with installation and configuration. It directs Kali Linux users to the best possible access points for updating data and packages.
- Branch: It points to the Kali Linux OS version that the user is currently using or the one user would like to switch, which requires editing information on the user Operating system sources list file.
- Component: It references Debian Free Software Guidelines and describes the type of OS packages that are preferred by Linux users. It can be a main component or a non-free component for the Linux community developers and users. Kali Linux chooses all types of OS packages by default.
Conclusion
Have got to know what the Kali Linux sources list is and how to add Kali Linux APT repositories to the source list file. We have also seen Kali Linux source format and explained with an example that shows Archive, Mirror, Branch, and Component, and finally, have gone through a few key takeaways.
Recommended Articles
This is a guide to Kali Linux Sources List. Here we discuss the introduction, how to add kali linux sources list, and kali linux sources format. You may also have a look at the following articles to learn more –