aboutsummaryrefslogtreecommitdiff
path: root/src/common-utils
diff options
context:
space:
mode:
authoreitsupi <50911393+eitsupi@users.noreply.github.com>2022-10-11 01:33:01 +0300
committerGitHub <noreply@github.com>2022-10-11 01:33:01 +0300
commita8cb375d460840bbf8c91599d16fc87d9ee8b996 (patch)
tree73dd647775325582c17a452816457f5cec82004d /src/common-utils
parent065b5ec9e19d4f289a070c3d5337696fd2394dc0 (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')
-rw-r--r--src/common-utils/devcontainer-feature.json2
-rwxr-xr-xsrc/common-utils/install.sh12
2 files changed, 11 insertions, 3 deletions
diff --git a/src/common-utils/devcontainer-feature.json b/src/common-utils/devcontainer-feature.json
index e916135..c5f8621 100644
--- a/src/common-utils/devcontainer-feature.json
+++ b/src/common-utils/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "common-utils",
- "version": "1.1.2",
+ "version": "1.1.3",
"name": "Common Debian Utilities",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils",
"description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.",
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!"