diff --git a/lib/functions/general/apt-utils.sh b/lib/functions/general/apt-utils.sh index 99bb5ffaee..9603633b58 100644 --- a/lib/functions/general/apt-utils.sh +++ b/lib/functions/general/apt-utils.sh @@ -58,6 +58,16 @@ function apt_find_upstream_package_version_and_download_url() { '.[$release][$arch]' $package_info_download_url_file ) + # Fallback for Ubuntu LTS releases: if not found with -updates suffix, try without it + if [[ "${found_package_filename}" != "${sought_package_name}_"* ]] && [[ "${DISTRIBUTION}" == "Ubuntu" ]] && [[ "${package_download_release}" == *"-updates" ]]; then + display_alert "Package not found with '-updates' suffix, trying without it" "${package_download_release} -> ${RELEASE}" "wrn" + package_download_release="${RELEASE}" + found_package_filename=$( + jq -r --arg release "${package_download_release}" --arg arch "${ARCH}" \ + '.[$release][$arch]' $package_info_download_url_file + ) + fi + if [[ "${found_package_filename}" == "${sought_package_name}_"* ]]; then display_alert "Found upstream base-files package filename" "${found_package_filename}" "info" else