We are hosting a branch of the debian jessie repository with custom, backported and patched packages. Every product release an ISO installer is created from this repo. We now noticed that an upgrade between a release from a couple of months ago to the release of this month fails. The problem occurs thanks to a custom package which had an incorrect configuration file under /etc/sysctl.d/. This results in systemd (because of procps) configuration failure during the upgrade. The custom package has been fixed, but during an upgrade the configuration of this package happens after the configuration of systemd.
A possiblity is to patch systemd and add our custom package as a dependency ...
Another idea was to work with Replace/Conflicts in the debian/control file, but I cannot seem to find any documentation about the upgrade order. Does apt-get upgrade start by replacing packages and then continue by upgrading the other packages?
Any other ideas how to get the custom package configured before systemd? (without installing it manually ourselves before starting the full upgrade)