@@ -59,21 +59,16 @@ get_common_setting() {
5959 echo " $1 =${! 1} "
6060}
6161
62- # Function to run apt-get if needed
63- apt_get_update_if_needed ()
62+ apt_get_update ()
6463{
65- if [ ! -d " /var/lib/apt/lists" ] || [ " $( ls /var/lib/apt/lists/ | wc -l) " = " 0" ]; then
66- echo " Running apt-get update..."
67- apt-get update
68- else
69- echo " Skipping apt-get update."
70- fi
64+ echo " Running apt-get update..."
65+ apt-get update -y
7166}
7267
7368# Checks if packages are installed and installs them if not
7469check_packages () {
7570 if ! dpkg -s " $@ " > /dev/null 2>&1 ; then
76- apt_get_update_if_needed
71+ apt_get_update
7772 apt-get -y install --no-install-recommends " $@ "
7873 fi
7974}
@@ -118,7 +113,7 @@ export DEBIAN_FRONTEND=noninteractive
118113# Install dependencies
119114check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
120115if ! type git > /dev/null 2>&1 ; then
121- apt_get_update_if_needed
116+ apt_get_update
122117 apt-get -y install git
123118fi
124119
212207 if [ " ${TARGET_COMPOSE_ARCH} " != " x86_64" ]; then
213208 # Use pip to get a version that runns on this architecture
214209 if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1 ; then
215- apt_get_update_if_needed
210+ apt_get_update
216211 apt-get -y install python3-minimal python3-pip libffi-dev python3-venv
217212 fi
218213 export PIPX_HOME=/usr/local/pipx
@@ -287,7 +282,7 @@ DOCKER_GID="$(grep -oP '^docker:x:\K[^:]+' /etc/group)"
287282# If enabling non-root access and specified user is found, setup socat and add script
288283chown -h " ${USERNAME} " :root " ${TARGET_SOCKET} "
289284if ! dpkg -s socat > /dev/null 2>&1 ; then
290- apt_get_update_if_needed
285+ apt_get_update
291286 apt-get -y install socat
292287fi
293288tee /usr/local/share/docker-init.sh > /dev/null \
0 commit comments