aboutsummaryrefslogtreecommitdiff
path: root/src/dotnet/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotnet/install.sh')
-rwxr-xr-xsrc/dotnet/install.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/dotnet/install.sh b/src/dotnet/install.sh
index d9399ca..fe4f58d 100755
--- a/src/dotnet/install.sh
+++ b/src/dotnet/install.sh
@@ -30,6 +30,11 @@ DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1="buster bullseye bionic focal hi
# alongside DOTNET_VERSION, but not set as default.
ADDITIONAL_VERSIONS=${ADDITIONALVERSIONS:-""}
+set -e
+
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
# Setup STDERR.
err() {
echo "(!) $*" >&2
@@ -109,8 +114,10 @@ updaterc() {
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
}
# Check if packages are installed and installs them if not.
@@ -463,4 +470,7 @@ if [ "${CHANGE_OWNERSHIP}" = "true" ]; then
find "${TARGET_DOTNET_ROOT}" -type d -print0 | xargs -n 1 -0 chmod g+s
fi
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
echo "Done!"