From 6cd95f55bb498151395e2ab021537444e5e25232 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Thu, 18 Jun 2026 16:57:04 +0800 Subject: [PATCH] fix: tolerate unavailable chrome package --- scripts/create-ai-workspace-offline-package.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/create-ai-workspace-offline-package.sh b/scripts/create-ai-workspace-offline-package.sh index e609bae..6e3c707 100755 --- a/scripts/create-ai-workspace-offline-package.sh +++ b/scripts/create-ai-workspace-offline-package.sh @@ -261,8 +261,13 @@ resolve_required_package() { case "$(dpkg --print-architecture)" in amd64) - if ! apt-cache show "google-chrome-stable=${GOOGLE_CHROME_VERSION}" >/dev/null 2>&1; then - echo "Required Google Chrome version is unavailable: ${GOOGLE_CHROME_VERSION}" >&2 + if apt-cache show "google-chrome-stable=${GOOGLE_CHROME_VERSION}" >/dev/null 2>&1; then + chrome_package="google-chrome-stable=${GOOGLE_CHROME_VERSION}" + elif apt-cache show google-chrome-stable >/dev/null 2>&1; then + echo "Required Google Chrome version is unavailable: ${GOOGLE_CHROME_VERSION}; using the repository candidate instead." >&2 + chrome_package="google-chrome-stable" + else + echo "Required Google Chrome package is unavailable for this target." >&2 exit 1 fi ;; @@ -310,7 +315,7 @@ for package in "${required_packages[@]}"; do done if [ "$(dpkg --print-architecture)" = "amd64" ]; then - packages+=("google-chrome-stable=${GOOGLE_CHROME_VERSION}") + packages+=("${chrome_package}") fi if apt-cache show docker-ce >/dev/null 2>&1; then