In order for custom PostInstallScript to add/remove apt packages and call apt update, DistUpgradecontroller needs to release the apt cache directory lock before that stage.
If the lock is still in place, DistUpgradeController.runPostUpgradeScripts hits errors such as:
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
In order for custom PostInstallScript to add/remove apt packages and call apt update, DistUpgradecont roller needs to release the apt cache directory lock before that stage.
If the lock is still in place, DistUpgradeCont roller. runPostUpgradeS cripts hits errors such as:
E: Could not get lock /var/lib/ apt/lists/ lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/