Open your terminal by pressing Ctrl + Alt + T or searching for “Terminal” in the Activities menu.
2. Update your package list by running `sudo apt update` command. This will ensure that you have the latest information about available packages and their versions.
3. Add the Debian Unstable repository to your system’s sources list by running:
#!/bin/bash
# This is a bash script that adds the Debian Unstable repository to the system's sources list.
# It is used to ensure that the latest information about available packages and their versions is obtained.
# To run this script, open the Terminal by pressing "Ctrl + Alt + T" or searching for "Terminal" in the Activities menu.
# Update the package list by running the "sudo apt update" command.
sudo apt update
# Add the Debian Unstable repository to the sources list by creating a new file named "debian.list" in the "/etc/apt/sources.list.d/" directory.
# The "echo" command is used to write the repository URL to the file.
echo "deb http://ftp.debian.org/debian unstable main contrib non-free" > /etc/apt/sources.list.d/debian.list
4. Add the Debian Experimental repository to your system’s sources list by running:
# This script adds the Debian Experimental repository to the system's sources list
# The "echo" command prints the specified string to the terminal
# The string in this case is the repository URL, followed by the location where it will be saved
# The ">" symbol redirects the output of the "echo" command to the specified file
# In this case, the repository URL will be saved in the "debian.list" file located in the "sources.list.d" directory
# The "deb" prefix indicates that this is a Debian repository
# The URL is followed by the repository type, which is "experimental"
# The "main" component specifies the main section of the repository, where the majority of packages are located
# The "/etc/apt/sources.list.d" directory is where additional sources lists can be stored
# The "debian.list" file is created in this directory to store the repository URL
echo "deb http://deb.debian.org/debian experimental main" > /etc/apt/sources.list.d/debian.list
5. Run `sudo apt update` again to ensure that the new repositories are added and updated in your system’s package list.
6. If you want to install packages from unstable or experimental, append the repository name to the end of the package name as shown below:
# This line installs the "socat" package from the "experimental" repository and the "netperf" package from the "unstable" repository.
sudo apt install socat/experimental netperf/unstable
7. To see what priority is assigned for a given package, run `sudo apt-cache policy` command. This will display all configured repositories and their priorities.
8. If you want to set your default distribution to “kali-rolling”, add the following line to /etc/apt/apt.conf.d/local file:
#!/bin/bash
# This line sets the default release for apt to "kali-rolling"
APT::Default-Release "kali-rolling";
# This line adds the specified text to the end of the /etc/apt/apt.conf.d/local file
echo "APT::Default-Release "kali-rolling";" >> /etc/apt/apt.conf.d/local
9. To reduce upgrade prompts, update your /etc/apt/apt.conf.d/local file with ‘DPkg::options { force-confdef; force-confold; }’ as shown below:
# This script is used to update the /etc/apt/apt.conf.d/local file to reduce upgrade prompts.
# The following line sets the options for dpkg, which is used for package management.
# The "--force-confdef" option forces dpkg to use the default configuration for any new configuration files.
# The "--force-confold" option forces dpkg to keep the old configuration for any existing configuration files.
DPkg::options { "--force-confdef"; "--force-confold"; }
# The following line sets the default release for apt, which is used for package management.
# The "kali-rolling" release is used for rolling updates in Kali Linux.
APT::Default-Release "kali-rolling";
10. To pin a package to a particular version, add the following line to /etc/apt/preferences file:
#!/bin/bash
# This script is used to pin a package to a particular version by adding a line to the /etc/apt/preferences file.
# The following code segment defines the package name.
Package: devscripts
# The following code segment specifies the version of the package to be pinned.
# The asterisk (*) is used as a wildcard to match any version number.
Pin: version 2.16.*
# The following code segment sets the priority for the pinned package.
# A higher priority number means a higher preference for the package.
Pin-Priority: 1001
11. For more information about APT and how to use it, refer to Kali Linux Revealed and The Debian Administrator’s Handbook.