diff --git a/install.sh b/install.sh index a740fe36..0d7e217c 100755 --- a/install.sh +++ b/install.sh @@ -498,13 +498,13 @@ do_install() { if ! is_dry_run; then set -x fi - $sh_c 'apt-get update -qq >/dev/null' - $sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $pre_reqs >/dev/null" + $sh_c 'apt-get -o DPkg::Lock::Timeout=60 update -qq >/dev/null' + $sh_c "DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=60 install -y -qq $pre_reqs >/dev/null" $sh_c 'install -m 0755 -d /etc/apt/keyrings' $sh_c "curl -fsSL \"$DOWNLOAD_URL/linux/$lsb_dist/gpg\" -o /etc/apt/keyrings/docker.asc" $sh_c "chmod a+r /etc/apt/keyrings/docker.asc" $sh_c "echo \"$apt_repo\" > /etc/apt/sources.list.d/docker.list" - $sh_c 'apt-get update -qq >/dev/null' + $sh_c 'apt-get -o DPkg::Lock::Timeout=60 update -qq >/dev/null' ) pkg_version="" if [ -n "$VERSION" ]; then @@ -546,7 +546,7 @@ do_install() { if ! is_dry_run; then set -x fi - $sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $pkgs >/dev/null" + $sh_c "DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=60 install -y -qq $pkgs >/dev/null" ) echo_docker_as_nonroot exit 0 diff --git a/rootless-install.sh b/rootless-install.sh index 0d964ff1..c8c5f348 100755 --- a/rootless-install.sh +++ b/rootless-install.sh @@ -127,8 +127,8 @@ checks() { # uidmap dependency check if ! command -v newuidmap >/dev/null 2>&1; then - if command -v apt-get >/dev/null 2>&1; then - INSTRUCTIONS="apt-get install -y uidmap" + if command -v apt-get -o DPkg::Lock::Timeout=60 >/dev/null 2>&1; then + INSTRUCTIONS="apt-get -o DPkg::Lock::Timeout=60 install -y uidmap" elif command -v dnf >/dev/null 2>&1; then INSTRUCTIONS="dnf install -y shadow-utils" elif command -v yum >/dev/null 2>&1; then @@ -142,9 +142,9 @@ yum install -y shadow-utils46-newxidmap" # iptables dependency check if [ -z "$SKIP_IPTABLES" ] && ! command -v iptables >/dev/null 2>&1 && [ ! -f /sbin/iptables ] && [ ! -f /usr/sbin/iptables ]; then - if command -v apt-get >/dev/null 2>&1; then + if command -v apt-get -o DPkg::Lock::Timeout=60 >/dev/null 2>&1; then INSTRUCTIONS="${INSTRUCTIONS} -apt-get install -y iptables" +apt-get -o DPkg::Lock::Timeout=60 install -y iptables" elif command -v dnf >/dev/null 2>&1; then INSTRUCTIONS="${INSTRUCTIONS} dnf install -y iptables"