diff --git a/.gitlab/ci/install.gitlab-ci.yml b/.gitlab/ci/install.gitlab-ci.yml index 28d0bb41b..41f31d137 100644 --- a/.gitlab/ci/install.gitlab-ci.yml +++ b/.gitlab/ci/install.gitlab-ci.yml @@ -16,7 +16,7 @@ upgrade: extends: .install-stage image: "after-install" script: - - apt update + - apt-get update -o Acquire::Retries=3 - DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes apt --assume-yes -o Dpkg::Options::="--force-confold" --allow-downgrades install ./$YNH_BUILD_DIR/*.deb @@ -24,7 +24,8 @@ install-postinstall: extends: .install-stage image: "before-install" script: - - apt update + - apt-get update -o Acquire::Retries=3 + - DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes apt --assume-yes -o Dpkg::Options::="--force-confold" --allow-downgrades install ./$YNH_BUILD_DIR/*.deb - DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes apt --assume-yes -o Dpkg::Options::="--force-confold" --allow-downgrades install ./$YNH_BUILD_DIR/*.deb - systemctl -q stop apt-daily.timer - systemctl -q stop apt-daily-upgrade.timer diff --git a/.gitlab/ci/test.gitlab-ci.yml b/.gitlab/ci/test.gitlab-ci.yml index 900d68bc3..12379342a 100644 --- a/.gitlab/ci/test.gitlab-ci.yml +++ b/.gitlab/ci/test.gitlab-ci.yml @@ -7,7 +7,7 @@ - systemctl -q disable apt-daily-upgrade.timer - systemctl -q disable apt-daily.service - systemctl -q disable apt-daily-upgrade.service - - apt update + - apt-get update -o Acquire::Retries=3 - DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes apt --assume-yes -o Dpkg::Options::="--force-confold" --allow-downgrades install ./$YNH_BUILD_DIR/*.deb .test-stage: diff --git a/data/helpers.d/apt b/data/helpers.d/apt index 31f7d4ffe..c48cc0add 100644 --- a/data/helpers.d/apt +++ b/data/helpers.d/apt @@ -100,7 +100,7 @@ ynh_package_version() { # Requires YunoHost version 2.4.0.3 or higher. ynh_apt() { ynh_wait_dpkg_free - LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get --assume-yes --quiet -o=Dpkg::Use-Pty=0 $@ + LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get --assume-yes --quiet -o=Acquire::Retries=3 -o=Dpkg::Use-Pty=0 $@ } # Update package index files diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index 0e9d23e87..3b683e967 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -416,7 +416,7 @@ def tools_update(apps=False, system=False): # Update APT cache # LC_ALL=C is here to make sure the results are in english - command = "LC_ALL=C apt update" + command = "LC_ALL=C apt-get update -o Acquire::Retries=3" # Filter boring message about "apt not having a stable CLI interface" # Also keep track of wether or not we encountered a warning...