]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: refresh package index before installing dependencies 63834/head
authorKefu Chai <tchaikov@gmail.com>
Tue, 10 Jun 2025 08:21:54 +0000 (16:21 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 10 Jun 2025 08:38:00 +0000 (16:38 +0800)
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 <tchaikov@gmail.com>
install-deps.sh

index 1cb05fe958f0f35daae1c8be7b8f87f4aaf26a42..01a20df24f72b42be7a240887a96e693da8619d9 100755 (executable)
@@ -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)