I'm trying to add a 'postinst' script to my debian package to clean up something a previous version may have left behind.

I've simply created a 'postinst' file in the debian/ directory, but the file is not present in the .deb file.

The permissions:

-rwxrwxr-x 1 kp kp 354 Sep 16 20:00 postinst*

The content:


set -e
set -x

  • can you post the file permissions for the postinst file and the contents of postinst Sep 19, 2011 at 15:11

1 Answer 1


You need to copy the postinst file (and other similar files) to the package staging directory. If you use dh_make, this is performed by dh_installdeb, which is of course included in dh install. If you're doing everything manually. copy the file to debian/tmp/DEBIAN/ where debian/tmp is the staging directory.

  • I didn't have the 'dh_installdeb' in my debian/rules file. Sep 20, 2011 at 8:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .