OnWorks Linux and Windows Online WorkStations

Logo

Free Hosting Online for WorkStations

< Previous | Contents | Next >

8.4. Package Reference: Digging Deeper into the Debian Package System‌


Now it is time to dive really deep into Debian and Kali’s package system. At this point, we are going to move beyond tools and syntax and focus more on the nuts and bolts of the packaging system. This behind-the-scenes view will help you understand how APT works at its foundation and will give you insight into how to seriously streamline and customize your Kali system. You may not necessarily memorize all the material in this section, but the walk-through and reference material will serve you well as you grow in your mastery of the Kali Linux system.

So far, you have interacted with APT’s package data through the various tools designed to interface with it. Next, we will dig deeper and take a look inside the packages and look at the internal meta- information (or information about other information) used by the package management tools.

This combination of a file archive and of meta-information is directly visible in the structure of a

.deb file, which is simply an ar archive, concatenating three files:


$ ar t /var/cache/apt/archives/apt_1.4~beta1_amd64.deb

debian-binary control.tar.gz data.tar.xz

$ ar t /var/cache/apt/archives/apt_1.4~beta1_amd64.deb

debian-binary control.tar.gz data.tar.xz


The debian-binary file contains a single version number describing the format of the archive:


$ ar p /var/cache/apt/archives/apt_1.4~beta1_amd64.deb debian-binary

2.0

$ ar p /var/cache/apt/archives/apt_1.4~beta1_amd64.deb debian-binary

2.0


The control.tar.gz archive contains meta-information:


$ ar p /var/cache/apt/archives/apt_1.4~beta1_amd64.deb control.tar.gz | tar -tzf -

./

./conffiles

./control

./md5sums

./postinst

./postrm

./preinst

./prerm

./shlibs

./triggers

$ ar p /var/cache/apt/archives/apt_1.4~beta1_amd64.deb control.tar.gz | tar -tzf -

./

./conffiles

./control

./md5sums

./postinst

./postrm

./preinst

./prerm

./shlibs

./triggers


And finally, the data.tar.xz archive (the compression format might vary) contains the actual files to be installed on the file system:


$ ar p /var/cache/apt/archives/apt_1.4~beta1_amd64.deb data.tar.xz | tar -tJf -

./

./etc/

./etc/apt/

./etc/apt/apt.conf.d/

./etc/apt/apt.conf.d/01autoremove

./etc/apt/preferences.d/

./etc/apt/sources.list.d/

./etc/apt/trusted.gpg.d/

./etc/cron.daily/

./etc/cron.daily/apt-compat

./etc/kernel/

./etc/kernel/postinst.d/

./etc/kernel/postinst.d/apt-auto-removal

./etc/logrotate.d/

./etc/logrotate.d/apt

./lib/

./lib/systemd/ [...]

$ ar p /var/cache/apt/archives/apt_1.4~beta1_amd64.deb data.tar.xz | tar -tJf -

./

./etc/

./etc/apt/

./etc/apt/apt.conf.d/

./etc/apt/apt.conf.d/01autoremove

./etc/apt/preferences.d/

./etc/apt/sources.list.d/

./etc/apt/trusted.gpg.d/

./etc/cron.daily/

./etc/cron.daily/apt-compat

./etc/kernel/

./etc/kernel/postinst.d/

./etc/kernel/postinst.d/apt-auto-removal

./etc/logrotate.d/

./etc/logrotate.d/apt

./lib/

./lib/systemd/ [...]


Note that in this example, you are viewing a .deb package in APT’s archive cache and that your archive may contain files with different version numbers than what is shown.

In this section, we will introduce this meta-information contained in each package and show you how to leverage it.

 

Top OS Cloud Computing at OnWorks: