Get Kali Repositories in Ubuntu

9th April 2019

To access the Kali PPA within Ubuntu, first add the kali repo to sources.list:

echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" >> sources.list"
apt update

This will throw an error when you attempt to update, likely whining about a key. Import it thusly:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ED444FF07D8D0BF6

Now we have the repo, we want to set its priority so that we will prefer Ubuntu packages, but install Kali packages if we don't have them already. For more details see https://wiki.debian.org/AptPreferences and the more digestible https://gist.github.com/JPvRiel/.

Add the following to /etc/apt/preferences (don't worry if you have to create it, you can worry about doing it properly in preferences.d later. Or never.):

Package: *
Pin: release o=Kali
Pin-Priority: 100

Please remember that, even with this, things may get a little prickly when installing a Kali package which shares dependencies with an Ubuntu package, especially if it's newer. Be mindful when installing stuff from the Internet!