Debian/Ubuntu – Prevent services from being started and enabled upon install

I like to set up Debian or Ubuntu as servers and have to install many applications before configuring them. Sometimes, I install an application just so that I have the option to use it at a later date if needed.

I don’t want these apps to automatically be enabled and started. This creates problems, especially if their settings hasn’t been changed and there are conflicts with other apps.

For example, I installed the following software: apt install nginx apache2 lighttpd.

And when I reboot, Nginx is listening on port 80, mis-configured and insecure, and I have to disable it.

enter image description here

I disable it and reboot, see now who took over the port:

enter image description here

If I disable lighttpd, Apache2 will take its place.

This doesn’t make sense, I feel like I’m fighting with the applications I install… Any way to make it stop? Any way to disable this behavior of enabling and starting services upon installation?

EDIT

Found a solution for preventing auto start:

echo exit 101 > /usr/sbin/policy-rc.d
chmod +x /usr/sbin/policy-rc.d

Found a solution for preventing auto enable:

https://unix.stackexchange.com/a/723679/547917

But this is ridiculous there’s nothing simpler, some kind of swtch using apt --no-enable --no-start, for example.