安装.deb时运行什么代码?

时间:2013-08-01 16:40:56

标签: linux debian

当我安装elasticsearch debian软件包时,文件将被复制到我系统中的各个文件夹中,并且弹出搜索服务器已启动。

这是怎么发生的? .deb包中的哪些文件包含所有这些安装信息?

当我查看软件包时,我看到以下文件:

➜  downloads  dpkg-deb -c elasticsearch-0.90.2.deb 
drwxr-xr-x root/root         0 2013-06-26 08:56 ./usr/
drwxr-xr-x root/root         0 2013-06-26 08:56 ./usr/share/
drwxr-xr-x root/root         0 2013-06-26 08:56 ./usr/share/elasticsearch/
-rw-r--r-- root/root       165 2013-06-26 08:56 ./usr/share/elasticsearch/NOTICE.txt
-rw-r--r-- root/root      7942 2013-06-26 08:56 ./usr/share/elasticsearch/README.textile
-rw-r--r-- root/root      2031 2013-06-26 08:56 ./usr/share/elasticsearch/core-signatures.txt
drwxr-xr-x root/root         0 2013-06-26 08:56 ./usr/share/elasticsearch/bin/
-rwxr-xr-x root/root      5511 2013-06-26 08:56 ./usr/share/elasticsearch/bin/elasticsearch
-rwxr-xr-x root/root      2099 2013-06-26 08:56 ./usr/share/elasticsearch/bin/elasticsearch.in.sh
-rwxr-xr-x root/root       740 2013-06-26 08:56 ./usr/share/elasticsearch/bin/plugin
drwxr-xr-x root/root         0 2013-06-26 08:56 ./usr/share/elasticsearch/lib/
-rw-r--r-- root/root  11000124 2013-06-26 08:56 ./usr/share/elasticsearch/lib/elasticsearch-0.90.2.jar
drwxr-xr-x root/root         0 2013-06-26 08:56 ./usr/share/elasticsearch/lib/sigar/
-rw-r--r-- root/root    246605 2013-06-26 08:56 ./usr/share/elasticsearch/lib/sigar/libsigar-amd64-linux.so
-rw-r--r-- root/root    494929 2013-06-26 08:56 ./usr/share/elasticsearch/lib/sigar/libsigar-ia64-linux.so
-rw-r--r-- root/root    233385 2013-06-26 08:56 ./usr/share/elasticsearch/lib/sigar/libsigar-x86-linux.so
-rw-r--r-- root/root    428580 2013-06-26 08:56 ./usr/share/elasticsearch/lib/sigar/sigar-1.6.4.jar
-rw-r--r-- root/root    865400 2013-06-26 08:56 ./usr/share/elasticsearch/lib/jna-3.3.0.jar
-rw-r--r-- root/root    770462 2013-06-26 08:56 ./usr/share/elasticsearch/lib/jts-1.12.jar
-rw-r--r-- root/root    489884 2013-06-26 08:56 ./usr/share/elasticsearch/lib/log4j-1.2.17.jar
-rw-r--r-- root/root   1563004 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-analyzers-common-4.3.1.jar
-rw-r--r-- root/root    296563 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-codecs-4.3.1.jar
-rw-r--r-- root/root   2213537 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-core-4.3.1.jar
-rw-r--r-- root/root    107736 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-grouping-4.3.1.jar
-rw-r--r-- root/root    123614 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-highlighter-4.3.1.jar
-rw-r--r-- root/root     63680 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-join-4.3.1.jar
-rw-r--r-- root/root     35907 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-memory-4.3.1.jar
-rw-r--r-- root/root    202556 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-queries-4.3.1.jar
-rw-r--r-- root/root    385813 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-queryparser-4.3.1.jar
-rw-r--r-- root/root     45506 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-sandbox-4.3.1.jar
-rw-r--r-- root/root     92692 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-spatial-4.3.1.jar
-rw-r--r-- root/root    142268 2013-06-26 08:56 ./usr/share/elasticsearch/lib/lucene-suggest-4.3.1.jar
-rw-r--r-- root/root     69290 2013-06-26 08:56 ./usr/share/elasticsearch/lib/spatial4j-0.3.jar
drwxr-xr-x root/root         0 2013-06-26 08:56 ./etc/
drwxr-xr-x root/root         0 2013-06-26 08:56 ./etc/default/
-rw-r--r-- root/root       890 2013-06-26 08:56 ./etc/default/elasticsearch
drwxr-xr-x root/root         0 2013-06-26 08:56 ./etc/init.d/
-rwxr-xr-x root/root      5469 2013-06-26 08:56 ./etc/init.d/elasticsearch
drwxr-xr-x root/root         0 2013-06-26 08:56 ./etc/elasticsearch/
-rw-r--r-- root/root     12519 2013-06-26 08:56 ./etc/elasticsearch/elasticsearch.yml
-rw-r--r-- root/root      1380 2013-06-26 08:56 ./etc/elasticsearch/logging.yml
drwxr-xr-x root/root         0 2013-06-26 08:56 ./usr/share/lintian/
drwxr-xr-x root/root         0 2013-06-26 08:56 ./usr/share/lintian/overrides/
-rw-r--r-- root/root       482 2013-06-26 08:56 ./usr/share/lintian/overrides/elasticsearch
drwxr-xr-x root/root         0 2013-06-26 08:56 ./usr/share/doc/
drwxr-xr-x root/root         0 2013-06-26 08:56 ./usr/share/doc/elasticsearch/
-rw-r--r-- root/root       741 2013-06-26 08:56 ./usr/share/doc/elasticsearch/copyright

1 个答案:

答案 0 :(得分:2)

.deb个文件是ar个档案。您可以使用

提取它
ar x elasticsearch-0.90.2.deb 

包含

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

您可以使用

提取control.tar.gz
tar xvzf control.tar.gz

这可以包含四个脚本:prermpreinstpostrmpostinst

postinst是安装后的脚本。

http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html