How do I ask apt-get to skip all post-install configuration steps?

How do I ask apt-get to skip any interactive post-install configuration steps?

export DEBIAN_FRONTEND=noninteractive
apt-get install -y [packagename]

Edit: yes, that was for skipping (well, automating) post-install questions, true - sorry.

There is no way to skip post-install scripts. The official Debian policy is to edit the script to return a non-terminal error, or fix the script. See http://www.debian-administration.org/articles/251

It sounds like you're automating this for many servers, in which case, you'll probably want to make your own version of the package and deploy that. Another option is to email the package maintainer and discuss whether a failure-to-start should be a terminal error for post-install (I don't believe it is for other packages like apache or lighttpd, for example, but I could be wrong.)


What you may want to do is something with the policy-rc.d. See the man page for invoke-rc.d. You can set a policy so services will not be automatically started.


this should work

echo exit 101 > /usr/sbin/policy-rc.d
chmod +x /usr/sbin/policy-rc.d
apt-get install <packagename>
rm -f /usr/sbin/policy-rc.d