diff --git a/scripts/release/debian/deb_install.sh b/scripts/release/debian/deb_install.sh index 529da64adaf..4326061f22b 100755 --- a/scripts/release/debian/deb_install.sh +++ b/scripts/release/debian/deb_install.sh @@ -60,10 +60,21 @@ setup() { CLI_REPO=$(lsb_release -cs) shopt -s nocasematch ERROR_MSG="Unable to find a package for your system. Please check if an existing package in https://packages.microsoft.com/repos/azure-cli/dists/ can be used in your system and install with the dist name: 'curl -sL https://aka.ms/InstallAzureCLIDeb | sudo DIST_CODE= bash'" - if [[ ! $(curl -sL https://packages.microsoft.com/repos/azure-cli/dists/) =~ $CLI_REPO ]]; then + AZURE_CLI_DISTS=$(curl -sL https://packages.microsoft.com/repos/azure-cli/dists/) + if [[ ! $AZURE_CLI_DISTS =~ $CLI_REPO ]]; then DIST=$(lsb_release -is) if [[ $DIST =~ "Ubuntu" ]]; then - CLI_REPO="jammy" + # Try supported Ubuntu LTS codenames newest-first + for lts_codename in noble jammy focal; do + if [[ $AZURE_CLI_DISTS =~ $lts_codename ]]; then + CLI_REPO="$lts_codename" + break + fi + done + if [[ -z $CLI_REPO ]]; then + echo "$ERROR_MSG" + exit 1 + fi elif [[ $DIST =~ "Debian" ]]; then CLI_REPO="bookworm" elif [[ $DIST =~ "LinuxMint" ]]; then diff --git a/scripts/release/debian/test_deb_install.sh b/scripts/release/debian/test_deb_install.sh index 92a34499e72..6ae55059933 100644 --- a/scripts/release/debian/test_deb_install.sh +++ b/scripts/release/debian/test_deb_install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -base_images=("ubuntu:xenial" "ubuntu:bionic" "debian:stretch" "debian:jessie" "debian:buster") +base_images=("ubuntu:xenial" "ubuntu:bionic" "ubuntu:noble" "debian:stretch" "debian:jessie" "debian:buster") set -e