From a8cb375d460840bbf8c91599d16fc87d9ee8b996 Mon Sep 17 00:00:00 2001 From: eitsupi <50911393+eitsupi@users.noreply.github.com> Date: Tue, 11 Oct 2022 07:33:01 +0900 Subject: Ensure remove apt-update cache at the beginning and end of the scripts (#210) * remove apt lists * bump versions --- src/common-utils/install.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/common-utils/install.sh') diff --git a/src/common-utils/install.sh b/src/common-utils/install.sh index 1170200..2d51a0b 100755 --- a/src/common-utils/install.sh +++ b/src/common-utils/install.sh @@ -9,6 +9,9 @@ set -e +# Clean up +rm -rf /var/lib/apt/lists/* + INSTALL_ZSH=${INSTALLZSH:-"true"} INSTALL_OH_MY_ZSH=${INSTALLOHMYZSH:-"true"} UPGRADE_PACKAGES=${UPGRADEPACKAGES:-"true"} @@ -60,8 +63,10 @@ export DEBIAN_FRONTEND=noninteractive apt_get_update() { - echo "Running apt-get update..." - apt-get update -y + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi } # Run install apt-utils to avoid debconf warning then verify presence of other common developer tools and dependencies @@ -447,4 +452,7 @@ echo -e "\ RC_SNIPPET_ALREADY_ADDED=${RC_SNIPPET_ALREADY_ADDED}\n\ ZSH_ALREADY_INSTALLED=${ZSH_ALREADY_INSTALLED}" > "${MARKER_FILE}" +# Clean up +rm -rf /var/lib/apt/lists/* + echo "Done!" -- cgit v1.2.3