Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
can you post the file permissions for the postinst file and the contents of postinst – RobotHumans Sep 19 '11 at 15:11
up vote 3 down vote accepted

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.

share|improve this answer
I didn't have the 'dh_installdeb' in my debian/rules file. – Kristof Provost Sep 20 '11 at 8:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.