From 938fe63ead3fc4a0323e2e7f3f24e576ad7ea957 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sun, 8 Mar 2026 23:27:04 +0100 Subject: [PATCH] chore: prevent installing recommended packages (e.g. installing cron leads to installing exim without it). --- cmdeploy/src/cmdeploy/deployers.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmdeploy/src/cmdeploy/deployers.py b/cmdeploy/src/cmdeploy/deployers.py index 22f5ef0ff..11536062d 100644 --- a/cmdeploy/src/cmdeploy/deployers.py +++ b/cmdeploy/src/cmdeploy/deployers.py @@ -6,7 +6,7 @@ import shutil import subprocess import sys -from io import StringIO +from io import BytesIO, StringIO from pathlib import Path from chatmaild.config import read_config @@ -478,6 +478,14 @@ def __init__(self, mail_domain): self.mail_domain = mail_domain def install(self): + files.put( + name="Disable installing recommended packages globally", + src=BytesIO(b'APT::Install-Recommends "false";\n'), + dest="/etc/apt/apt.conf.d/00InstallRecommends", + user="root", + group="root", + mode="644", + ) apt.update(name="apt update", cache_time=24 * 3600) apt.upgrade(name="upgrade apt packages", auto_remove=True)