I build my own package and I need to check something on the system before the install process.
So in my dpkg I add a preinst script which is written as follow. As an example I want to check if the arduino-cli command is available:
echo 'Check arduino cli install ...'
if ! command -v arduino-cli &> /dev/null
then
exit 0
fi
The postinst script seems to be execute. Here is the result of the dpkg execution:
....
dpkg: error processing archive myserver-server_0_amd64.deb (--install):
...
How can I stop the other script ? I thought the exit command should work. https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html