postinst 脚本在安装后不运行

postinst 脚本在安装后不运行

我有一个具有以下文件夹结构的文件夹:

total 8
drwxr-xr-x 2 pi pi 4096 mar 21 19:08 DEBIAN
drwxr-xr-x 6 pi pi 4096 mar 21 18:02 usr

里面的DEBIAN文件夹:

-rw-r--r-- 1 pi pi   150 mar 21 18:05 changelog
-rw-r--r-- 1 pi pi     2 mar 21 18:05 compat
-rw-r--r-- 1 pi pi   516 mar 21 18:05 control
-rw-r--r-- 1 pi pi 13774 mar 21 18:05 copyright
-rwxr-xr-x 1 pi pi  1396 mar 21 20:45 postinst
-rwxr-xr-x 1 pi pi   919 mar 21 19:08 postrm
-rwxr-xr-x 1 pi pi   679 mar 21 19:08 preinst
-rwxr-xr-x 1 pi pi   866 mar 21 19:08 prerm

文件postinst内容如下:

#!/bin/sh
# postinst script for cpython
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    configure)
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)

        #echo "postinst called with unknown argument \`$1'" >&2
        #exit 1
    ;;
esac

ln -sf XXX YYY

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.


exit 0

使用、、、dh_installdeb的命令将脚本复制到该文件夹​​中。 (这些文件是用命令生成的)。package.postinstpackage.postrmpackage.preinstpackage.prermdh_make -f

当我运行fakeroot dpkg-deb --build python3.6创建时.deb,它会创建.deb,但是当我尝试安装它时,它不会运行postinst(它不会创建脚本中出现的符号链接)。

一件奇怪的事情是,在该DEBIAN文件夹中,脚本包含以下内容:

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

如果我提取生成的内容.deb并检查postinst文件,我会观察到相同的消息:

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

这句话让我觉得我忘记了什么或者做错了什么。

postinst为什么我的脚本在sudo dpkg -i xxx.deb命令之后不运行?

相关内容