Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 had a quick dpkg/debian-izing question. I am trying to create a .deb(by hand - mostly for learning purposes) and I have rolled up an ar-chive with the control.tar.gz, data.tar.gz and the debian-binary files.

This hand-rolled .deb works fine for regular installs, purges et al. However when I specify an --instdir at install time, dpkg reports a 'file not found' error when trying to run the postinst script. This is not an issue with the prerm script, btw(which works fine).

Running dpkg with --debug=2000 and looking at /var/log/dpkg.log didn't help much.

Any thoughts on why this could be happening?


To give some more context and pose another question: I am trying to get --instdir to work mostly because the top level directory to which my package contents get installed is also a mount point and on doing dpkg -P foo, dpkg attempts to remove this directory. If anyone can suggest a workaround for this, that would serve my purpose too(i.e. I wouldn't need --instdir to work). Also, this top-level directory is not empty, so not sure why dpkg is attempting to remove it. Putting a .placeholder file in there didn't help either.

share|improve this question

As it is listed here ( dynamic directory paths are not supported in deb packages with prepackaged binaries. But you can specify the directory path not at runtime but in your control file. And for easy making of packages you can use some graphical tools (ex., mentioned here:

share|improve this answer

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.