From b5573b656e2d592e3c3f180b5b8c5142d3b44b23 Mon Sep 17 00:00:00 2001 From: Rahul Sharma Date: Fri, 30 Jan 2026 20:47:22 -0800 Subject: [PATCH] update cache before running install Signed-off-by: Rahul Sharma --- ubuntu22.04/nvidia-driver | 6 +++++- ubuntu22.04/precompiled/nvidia-driver | 8 +++++++- ubuntu24.04/nvidia-driver | 6 +++++- ubuntu24.04/precompiled/nvidia-driver | 8 +++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ubuntu22.04/nvidia-driver b/ubuntu22.04/nvidia-driver index 1f4750e84..0039a674d 100755 --- a/ubuntu22.04/nvidia-driver +++ b/ubuntu22.04/nvidia-driver @@ -39,7 +39,11 @@ _enable_fips_if_required() { _update_package_cache() { if [ "${PACKAGE_TAG:-}" != "builtin" ]; then echo "Updating the package cache..." - apt-get -qq update + if ! apt-get -qq update; then + echo "ERROR: Failed to update package cache. "\ + "Ensure that the cluster can access the proper networks." + exit 1 + fi fi } diff --git a/ubuntu22.04/precompiled/nvidia-driver b/ubuntu22.04/precompiled/nvidia-driver index 8efd3c3db..1394b03e4 100755 --- a/ubuntu22.04/precompiled/nvidia-driver +++ b/ubuntu22.04/precompiled/nvidia-driver @@ -62,7 +62,11 @@ nvsdm_install() { _update_package_cache() { if [ "${PACKAGE_TAG:-}" != "builtin" ]; then echo "Updating the package cache..." - apt-get -qq update + if ! apt-get -qq update; then + echo "ERROR: Failed to update package cache. "\ + "Ensure that the cluster can access the proper networks." + exit 1 + fi fi } @@ -450,6 +454,8 @@ init() { _unload_driver || exit 1 _unmount_rootfs + _update_package_cache + _create_module_params_conf _install_driver _load_driver || exit 1 diff --git a/ubuntu24.04/nvidia-driver b/ubuntu24.04/nvidia-driver index 6c2d90a44..b272fcd86 100755 --- a/ubuntu24.04/nvidia-driver +++ b/ubuntu24.04/nvidia-driver @@ -49,7 +49,11 @@ _enable_fips_if_required() { _update_package_cache() { if [ "${PACKAGE_TAG:-}" != "builtin" ]; then echo "Updating the package cache..." - apt-get -qq update + if ! apt-get -qq update; then + echo "ERROR: Failed to update package cache. "\ + "Ensure that the cluster can access the proper networks." + exit 1 + fi fi } diff --git a/ubuntu24.04/precompiled/nvidia-driver b/ubuntu24.04/precompiled/nvidia-driver index 1a17e0a63..824c0a1bc 100755 --- a/ubuntu24.04/precompiled/nvidia-driver +++ b/ubuntu24.04/precompiled/nvidia-driver @@ -63,7 +63,11 @@ nvsdm_install() { _update_package_cache() { if [ "${PACKAGE_TAG:-}" != "builtin" ]; then echo "Updating the package cache..." - apt-get -qq update + if ! apt-get -qq update; then + echo "ERROR: Failed to update package cache. "\ + "Ensure that the cluster can access the proper networks." + exit 1 + fi fi } @@ -451,6 +455,8 @@ init() { _unload_driver || exit 1 _unmount_rootfs + _update_package_cache + _create_module_params_conf _install_driver _load_driver || exit 1