From d4c6b9c8039b0ce82da61b00a2376bfe8826f0c0 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 10 Jun 2025 16:21:54 +0800 Subject: [PATCH] install-deps.sh: refresh package index before installing dependencies Fix dependency installation failures caused by outdated package indexes on Debian-based systems. When the host's package index is stale, package installation can fail with HTTP 404 errors because updated packages are no longer available at their cached URLs. Recent build server failures show this issue: ``` E: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/pool/main/o/openldap/libldap-2.5-0_2.5.18%2bdfsg-0ubuntu0.22.04.3_arm64.deb 404 Not Found [IP: 91.189.91.104 80] E: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/pool/main/o/openldap/libldap-dev_2.5.18%2bdfsg-0ubuntu0.22.04.3_arm64.deb 404 Not Found [IP: 91.189.91.104 80] E: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/pool/main/o/openldap/libldap2-dev_2.5.18%2bdfsg-0ubuntu0.22.04.3_all.deb 404 Not Found [IP: 91.189.91.104 80] ``` In this change, we add `apt-get update` before installing the ceph-build-deps meta package, following the same pattern used in ensure_decent_gcc_on_ubuntu(). Note: Additional `apt-get update` calls are still required when installing packages from custom repositories after adding their source lists. Signed-off-by: Kefu Chai --- install-deps.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install-deps.sh b/install-deps.sh index 1cb05fe958f0f..01a20df24f72b 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -381,6 +381,12 @@ else # Put this before any other invocation of apt so it can clean # up in a broken case. clean_boost_on_ubuntu + + # update the local package index before installing any packages from the + # official repo + $SUDO env DEBIAN_FRONTEND=noninteractive apt-get update \ + -y -o Acquire::Languages=none -o Acquire::Translation=none || true + if [ "$INSTALL_EXTRA_PACKAGES" ]; then if ! $SUDO apt-get install -y $INSTALL_EXTRA_PACKAGES ; then # try again. ported over from run-make.sh (orignally e278295) -- 2.39.5