Kali Linux Revealed




Download 11,68 Mb.
Pdf ko'rish
bet128/174
Sana15.01.2024
Hajmi11,68 Mb.
#137314
1   ...   124   125   126   127   128   129   130   131   ...   174
Bog'liq
Kali-Linux-Revealed-2021-edition

The
dpkg
Database
You can traverse the
dpkg
database on the filesystem at
/var/lib/dpkg/
. This di-
rectory contains a running record of all the packages that have been installed on
the system. All of the configuration scripts for installed packages are stored in the
/var/lib/dpkg/info/
directory, in the form of a file prefixed with the package’s
name:
ls /var/lib/dpkg/info/zsh.*
/var/lib/dpkg/info/zsh.list
/var/lib/dpkg/info/zsh.md5sums
/var/lib/dpkg/info/zsh.postinst
/var/lib/dpkg/info/zsh.postrm
/var/lib/dpkg/info/zsh.preinst
/var/lib/dpkg/info/zsh.prerm
This directory also includes a file with the
.list
extension for each package, contain-
ing the list of files that belong to that package:
6
https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
217
Chapter 8 — Debian Package Management


head /var/lib/dpkg/info/zsh.list
/.
/bin
/bin/zsh
/bin/zsh5
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/zsh
/usr/lib/x86_64-linux-gnu/zsh/5.2
/usr/lib/x86_64-linux-gnu/zsh/5.2/zsh
[...]
The
/var/lib/dpkg/status
file contains a series of data blocks (in the format of
the famous mail headers request for comment, RFC 2822) describing the status of
each package. The information from the
control
file of the installed packages is also
replicated there.
more /var/lib/dpkg/status
Package: gnome-characters
Status: install ok installed
Priority: optional
Section: gnome
Installed-Size: 1785
Maintainer: Debian GNOME Maintainers 
å
maintainers@lists.alioth.debian.org>
Architecture: amd64
Version: 3.20.1-1
[...]
Let’s discuss the configuration files and see how they interact. In general, the
preinst
script is
executed prior to installation of the package, while the
postinst
follows it. Likewise,
prerm
is
invoked before removal of a package and
postrm
afterwards. An update of a package is equivalent
to removal of the previous version and installation of the new one. It is not possible to describe in
detail all the possible scenarios here but we will discuss the most common two: an installation/up-
date and a removal.
These sequences can be quite confusing, but a visual representation may help.
Manoj Srivastava
made some diagrams
7
explaining how the configuration scripts are called by
dpkg
.
Similar dia-
grams have also been developed by the Debian Women project
8
; they are a bit simpler to under-
stand, but less complete.
7
https://people.debian.org/~srivasta/MaintainerScripts.html
8
https://wiki.debian.org/MaintainerScripts
218
Kali Linux Revealed


Caution

Download 11,68 Mb.
1   ...   124   125   126   127   128   129   130   131   ...   174




Download 11,68 Mb.
Pdf ko'rish