From b61ccaf6f75e23206085e5ed40b0e1c9713266ae Mon Sep 17 00:00:00 2001 From: Bryan Roth Date: Mon, 6 Oct 2025 17:18:10 -0400 Subject: [PATCH] Fix: TLS version mismatch for newer Pi OS versions. https://askubuntu.com/questions/1408000/unable-to-locate-package-libssl1-1#1412746 --- RaspberryDebugger/Connection/Connection.cs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/RaspberryDebugger/Connection/Connection.cs b/RaspberryDebugger/Connection/Connection.cs index f5f0362..b7f871f 100644 --- a/RaspberryDebugger/Connection/Connection.cs +++ b/RaspberryDebugger/Connection/Connection.cs @@ -585,15 +585,29 @@ private async Task InstallSdkPrerequsitesAsync() async () => { var downloadScript = - $""" + """ # Ensure that the packages required by .NET Core are installed: # https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian#dependencies if ! apt-get update ; then exit 1 fi - - if ! apt-get install -yq libc6 libgcc1 libgssapi-krb5-2 libicu-dev libssl1.1 libstdc++6 zlib1g libgdiplus ; then - exit 1 + + debianVersion=$(cat /etc/debian_version) + compareArray=($debianVersion "12") + IFS=$'\n' sorted=($(sort -n <<<"${compareArray[*]}")) + unset IFS + + if [ "${sorted[0]}" == "12" ]; then + # Debian 12 or newer + if ! apt-get install -yq libc6 libgcc-s1 libgssapi-krb5-2 libicu-dev libssl3 libstdc++6 zlib1g libgdiplus ; then + exit 1 + fi + exit 0 + else + # Older than Debian 12 + if ! apt-get install -yq libc6 libgcc1 libgssapi-krb5-2 libicu-dev libssl1.1 libstdc++6 zlib1g libgdiplus ; then + exit 1 + fi fi exit 0