Feature Requests
New / Open / Unreviewed

Allow customizing the APT update command

I would like to suggest adding an option to customize the command used by the agent when performing package updates.

Use case

When PatchMon runs an APT upgrade, the process can fail or become non-interactive when a package has a modified configuration file and a new version of that configuration file is available.

For unattended server patching, I would like to be able to pass the following options to apt:

-o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold"

This makes dpkg automatically use the default action where one is available, while keeping the currently installed configuration when a modified configuration file requires a decision. This is a common approach for automated Debian/Ubuntu upgrades.

Suggested solutions

There are two possible approaches:

  1. Add a dedicated option for APT configuration handling, for example an option such as Keep existing configuration files, which would add:

    -o Dpkg::Options::="--force-confdef"
    -o Dpkg::Options::="--force-confold"

  2. Allow the update command to be customized, at least for each package manager.

    This would be more flexible and would allow users to adapt PatchMon's update behavior to their particular environment without requiring changes to the agent.

I would personally prefer the second option if it can be implemented safely, as there may be other APT/dpkg options that users need to pass for specific environments.

PatchMon already supports several package managers, so having package-manager-specific command configuration could also make this feature useful beyond APT.

Expected result

For example, an administrator could configure the APT update command to effectively run:

apt-get -y \
-o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold" \
upgrade

This would make automated patching more reliable on systems where configuration files have been locally modified.

Thanks for considering this feature!

0 Comments

Posting anonymously

No comments yet. Be the first to share your thoughts!