diff options
author | eitsupi <50911393+eitsupi@users.noreply.github.com> | 2022-10-11 01:33:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 01:33:01 +0300 |
commit | a8cb375d460840bbf8c91599d16fc87d9ee8b996 (patch) | |
tree | 73dd647775325582c17a452816457f5cec82004d /src/common-utils/install.sh | |
parent | 065b5ec9e19d4f289a070c3d5337696fd2394dc0 (diff) |
Ensure remove apt-update cache at the beginning and end of the scripts (#210)
* remove apt lists
* bump versions
Diffstat (limited to 'src/common-utils/install.sh')
-rwxr-xr-x | src/common-utils/install.sh | 12 |
1 files changed, 10 insertions, 2 deletions
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!" |