From f6a50b6db204fa1a6d0ae8b371c4108911aed0eb Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Mon, 30 Mar 2020 23:57:47 +0100 Subject: [PATCH] packages: remove auto-installed on removal i've been noticing that in the binary_syslinux stage a wholebunch of packages get installed whilst installing isolinux, and then upon removing the installed packages at the end of the script, apt is listing a large number of those that were auto installed as no longer in use and can be removed via `apt autoremove`. this then persists through package installation and removal steps throughout remaining scripts. adding `--auto-remove` to `apt-get remove --purge` and similarly `--purge-unused` to `aptitude purge` instructs apt to get rid of the unused auto-installed packages at the same time as removing specific package that brought them in in the first place, and thus resolves the problem. Gbp-Dch: Short --- functions/packages.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/packages.sh b/functions/packages.sh index fa16b1161..0fd057ec7 100755 --- a/functions/packages.sh +++ b/functions/packages.sh @@ -52,11 +52,11 @@ Remove_package () then case "${LB_APT}" in apt|apt-get) - Chroot chroot "apt-get remove --purge ${APT_OPTIONS} ${_LB_PACKAGES}" + Chroot chroot "apt-get remove --auto-remove --purge ${APT_OPTIONS} ${_LB_PACKAGES}" ;; aptitude) - Chroot chroot "aptitude purge ${APTITUDE_OPTIONS} ${_LB_PACKAGES}" + Chroot chroot "aptitude purge --purge-unused ${APTITUDE_OPTIONS} ${_LB_PACKAGES}" ;; esac fi