In short: apt-get install
does everything that is needed that your system can successfully execute the new installed software application.
Longer version:
Preliminaries:
From the manpage:
All packages required by the package(s) specified for installation
will also be retrieved and installed.
Those packages are stored on a repository in the network (internet). So, apt-get
downloads all the needed packages into a temporary directory (/var/cache/apt/archives/
). They will be downloaded from a web- or an ftp-server. They are specified in the so called sources.list
; a list of repositories for the package manager apt. From then on, they get installed one by one procedurally.
The first ones to be installed are the ones that have no further dependencies; so no other package has to be installed for them to work properly. Through that, other packages (that had dependencies previously) haven't now dependencies anymore. The system keeps doing that process over and over until the specified packages are installed.
Each package undergoes an installation procedure.
Package installation procedure:
In Debian-based Linux distributions, such as Ubuntu or Mint, those packages are in a specified standardized format called: deb --> The Debian binary package format.
Such a package contains the files to be installed on the system. Also they contain a control file. That file contains scripts that the packaging system should execute in a specific situation; the so-called maintainer scripts. Those scripts are split in:
preinst
: before the installation of the files into the systems file hierarchy
postinst
: after the installation
prerm
: before the uninstallation
postrm
: after the uninstallation
Those scripts are the place where specific users are created or some services that need to be restarted or other preliminaries that are needed for the package to work.
Besides those scripts, the package system has triggers that are intended for specific events. For example, the regeneration of initrds when installing a new kernel version or ldconfig or the man-db. They are activated by one or more packages and run in the end of the whole installation process.
There is an interesting picture, showing the procedure of an installation of a new package:
![installation](../../I/static/images/42488ae786cea6502224597ad427a7c413a5e3372aebb0b12f96d413b55ba78b.png)
There are also more control-files, the most important are as follows:
If you are interested, you can unpack a deb package (after downloading) manually and watch what's inside:
# to only download the package (no installation)
apt-get download package
# to unpack the deb file
ar x package.deb
Now you see a file called data.tar.gz
containing the files and a file called control.tar.gz
containing the four maintainer scripts and the above-mentioned control-files.
Nowadays I believe it'll be better to use
dpkg-deb -x package.deb
instead ofar x package.deb
, sincedpkg
is the official deb package manager (over which apt-get is used). – Fanatique – 2019-05-28T11:26:42.180