Sometimes installing some applications will start a process or service from the application being run automatically on installation. How do I install without starting them?
There's a slightly hackish, but quite reliable way to do this which I've been using for a while in an automated installation script.
First create a directory, for example
You could also make them bash scripts that do nothing and return success.
Then include that directory at the front of
This only prevents daemons from starting/restarting, while things like creating an initramfs are still being done.
The scripts which are being executed at package installation and removal execute
So by inserting the faked "no operation" commands at the beginning of
Since only the commands used to start/stop services are being faked, everything else, in particular important tasks like updating/creating initramfs-images still work.
|show 2 more comments|
Background daemons are started with
What I ended up doing is emulating what debootstrap does when installing packages, except I used dpkg-divert:
First move the real files out of the way:
Then create dummy versions:
Then do your apt-get upgrades, installs, etc., and then clean up with:
I know there are other commands that can be used to stop/start services, but debootstrap only cares about
I believe you need to use the
To make this setting persistent so that
Note that dpkg still logs triggers as having run even though they haven't:
Alternatively, you can have the installer script run the
A quick one-liner: