I'm trying to make my own debian package to deploy some scripts. I need some parameters from the user, I'm gathering them using debconf.
So I made a DEBIAN subfolder, and put control, templates and config files into it.
Then I build my package with dpkg-deb.
When I install the package with
apt install packagename.deb, debconf questions are asked and everything goes well.
But when I install with
dpkg -i packagename.deb, no questions are asked, and installation fails lacking necessary variables.
I also tested to run
dpkg-preconfigure packagename.deb, and questions are asked.
Why dpkg doesn't trigger the config script ?
Some logs showing there isn't "Preconfiguring" with dpkg :
root@test-deploy:~# dpkg -i /tmp/packagename-6.5.deb Selecting previously unselected package packagename. (Reading database ... 41282 files and directories currently installed.) Preparing to unpack /tmp/packagename-6.5.deb ... Unpacking packagename (6.5-1) ... Setting up packagename (6.5-1) ... root@test-deploy:~# apt install /tmp/packagename-6.5.deb Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'packagename' instead of '/tmp/packagename-6.5.deb' The following NEW packages will be installed: packagename 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/381 MB of archives. After this operation, 0 B of additional disk space will be used. Get:1 /tmp/packagename-6.5.deb packagename amd64 6.5-1 [381 MB] Preconfiguring packages ... Selecting previously unselected package packagename. (Reading database ... 41282 files and directories currently installed.) Preparing to unpack /tmp/packagename-6.5.deb ... Unpacking packagename (6.5-1) ...`
Just to be sure, I extracted control information from the deb file : it is OK.
root@test-deploy:/tmp# dpkg -e packagename-6.5.deb
root@test-deploy:/tmp# ls -l DEBIAN/
-rwxr-xr-x 1 root root 3337 Aug 21 16:21 config
-rw-r--r-- 1 root root 357 Aug 19 11:55 control
-rwxr-xr-x 1 root root 293 Aug 13 15:44 postinst
-rwxr-xr-x 1 root root 366 Aug 21 15:10 prerm
-rw-r--r-- 1 root root 2384 Aug 19 15:39 templates