Ubuntu - apt-get - Prevent server (daemons) from starting during apt-get install

Sometimes it is not wanted for a server or daemon to start as part of the postinstall scrip when installing with apt-get or dpkg.


Prevent servers from starting during apt-get install

mkdir -p /usr/sbin/
cat < /usr/sbin/policy-rc.d
#!/bin/sh
exit 101
EOF
chmod 755 /usr/sbin/policy-rc.d

NOTE: When done, do not forget to remove this file with:

rm -f /usr/sbin/policy-rc.d