From 3fd475a5fa237956e808e62cd50374cd07d63e4b Mon Sep 17 00:00:00 2001 From: llamasoft Date: Thu, 8 Sep 2022 04:25:41 +0000 Subject: [PATCH] Actually clean the apt cache As the added comments describe, the options available to us from Ansible's apt module don't actually clean the apt cache. Manually running apt-get clean recovers around 400MB of space. Signed-off-by: llamasoft --- builder/pwnagotchi.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index dd07e2ccd..117c113f5 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -381,9 +381,14 @@ You learn more about me at https://pwnagotchi.ai/ when: hostname.changed + # Ansible's apt module has an "autoclean" option but it only removes packages + # that can no longer be downloaded. Ansible v2.13 added the "clean" option + # which actually purges the apt cache, but that's newer than what we can + # install from the RasPiOS repos. Instead, we'll manually clean the cache. - name: clean apt cache - apt: - autoclean: yes + command: "apt-get clean" + args: + warn: false - name: remove dependencies that are no longer required apt: