diff --git a/cluster/apt.apply.update.sh b/cluster/apt.apply.update.sh index 42abaa0..7b1e4c9 100755 --- a/cluster/apt.apply.update.sh +++ b/cluster/apt.apply.update.sh @@ -222,6 +222,16 @@ Try to apply APT upgrades". DEBIAN_FRONTEND=noninteractive aptitude -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold full-upgrade >> "${APT_TMP_FILE}" 2>&1 +} +# }}} +clean_host() { # {{{ + + debug_message "clean_host − \ +Try to clean temp files, downloaded packages,…". + + aptitude clean >> "${APT_TMP_FILE}" 2>&1 \ + && rm -f -- "${APT_TMP_FILE}" + } # }}} main() { # {{{ @@ -256,9 +266,11 @@ main() { # {{{ && exit 0 ## Try to upgrade the system - ### Exit 50 if any error in returned value + ### If error: Exit 50 + ### If success: Clean host (temp files, download,…) upgrade_system \ - || exit 50 + || exit 50 \ + && clean_host ## If Maco upgrade is present ### Exit (and leave Maco manage required reboot if present)