Metapackages are empty packages which declare other dependencies. This is one of many things that we can do using APT. Kali Linux has metapackages to help with password cracking and software-defined radio and wireless. However, if you have unique needs, it is easy and quick to create your own metapackages. We will demonstrate this in the post.
We need to first install the Devscripts Package, which contains a variety of utilities and tools for managing packages.
:# Apache install Devscripts
All metapackages in Kali are described in the appropriately-named Kali-meta package. We can then clone it and make modifications to fit our requirements.
[email protected]:~# git clone git://gitlab.com/kalilinux/packages/kali-meta Cloning into 'kali-meta'... remote: Counting objects: 998, done. Remote: Compressing objects at 100% (809/809), completed. remote: Total 998 (delta 365), reused 0 (delta 0) Receiving objects: 100% (998/998), 179.90 KiB | 570.00 KiB/s, done. Resolving deltas: 100% (365/365), done. Warning: Remote HEAD is a non-existent ref that cannot be checked.
Although the “unable to checkout” message looks alarming, it is only a sign that the default branch (kali/master), needs to first be checked out. This can be done by following these steps.
[email protected]:~# cd kali-meta/ [email protected]:~/kali-meta# git checkout kali/master Branch 'kali/master' set up to track remote branch 'kali/master' from 'origin'. Switched to a new branch 'kali/master' [email protected]:~/kali-meta#
We need to modify the control file that contains the package information in order to create or update a metapackage. A metapackage is simply a list of dependencies on packages, such as the one below for the Kali-linux_gpu.
Package: Kali-linux-gpu Architecture : Any Depends: $misc.Depends kali Linux: Python, Oclhashcat (amd64-i386], Pyit, Oclgausscrack (amd64-i386], Truecrack,
The new metapackage we will use will be called Kali Linux-mytools and install Vagrant and VirtualBox as well as LibreOffice and Chromium. This is our entry for the metapackage.
[email protected]:~/kali-meta# tail -n 14 debian/control Package: kali-linux-mytools Architecture: any Depends: $misc:Depends, kali-linux, virtualbox, vagrant, libreoffice, chromium, Description: My required Kali tools This is Kali Linux, the most advanced penetration testing and security auditing distribution. . The tools that I use most frequently will determine the metapackage.
Once the metapackage has been defined, it is time to change the version number using ‘dch’ before we can build the package. You will be able to use the editor to edit changelog.
:~/kali-meta# dch --local dookie :~/kali-meta# head -n 5 debian/changelog kali-meta (2018.3.2dookie1) UNRELEASED; urgency=medium * Added kali-linux-mytools -- dookie <> Tue, 11 Sep 2018 09:40:10 -0600
We can now build our new package using the “dpkg-buildpackage” command. The build is quick because metapackages only contain lists of dependencies.
[email protected]:~/kali-meta# dpkg-buildpackage -us -uc -b dpkg-buildpackage: info: source package kali-meta dpkg-buildpackage: info: source version 2018.3.2dookie1 dpkg-buildpackage: info: source distribution UNRELEASED dpkg-buildpackage: info: source changed by dookie dpkg-buildpackage: info: host architecture amd64 ... dpkg-deb: building package 'kali-linux-pwtools' in '../kali-linux-pwtools_2018.3.2dookie1_amd64.deb'. dpkg-deb: building package 'kali-linux-top10' in '../kali-linux-top10_2018.3.2dookie1_amd64.deb'. dpkg-deb: building package 'kali-linux-mytools' in '../kali-linux-mytools_2018.3.2dookie1_amd64.deb'. dpkg-genbuildinfo --build=binary dpkg-genchanges --build=binary >../kali-meta_2018.3.2dookie1_amd64.changes dpkg-genchanges: info: binary-only upload (no source code included) dpkg-source --after-build kali-meta dpkg-buildpackage: info: binary-only upload (no source included)
Once the build is completed, you can install our metapackage with “apt” like every other package.
:~/kali-meta# apt install ../kali-linux-mytools_2018.3.2dookie1_amd64.deb ... :~/kali-meta# apt-cache policy vagrant virtualbox libreoffice chromium vagrant: Installed: 2.1.2+dfsg-1 Candidate: 2.1.2+dfsg-1 Version table: *** 2.1.2+dfsg-1 500 500 http://192.168.86.4/kali kali-rolling/main amd64 Packages 100 /var/lib/dpkg/status virtualbox: Installed: 5.2.18-dfsg-2 Candidate: 5.2.18-dfsg-2 Version table: *** 5.2.18-dfsg-2 500 500 http://192.168.86.4/kali kali-rolling/contrib amd64 Packages 100 /var/lib/dpkg/status libreoffice: Installed: 1:6.1.1~rc1-2 Candidate: 1:6.1.1~rc1-2 Version table: *** 1:6.1.1~rc1-2 500 500 http://192.168.86.4/kali kali-rolling/main amd64 Packages 100 /var/lib/dpkg/status chromium: Installed: 68.0.3440.75-2 Candidate: 68.0.3440.75-2 Version table: *** 68.0.3440.75-2 500 500 http://192.168.86.4/kali kali-rolling/main amd64 Packages 100 /var/lib/dpkg/status
We have our metapackage, which we can place on network share and other locations to help us quickly set up our Kali Linux installation.