@@ -915,13 +915,8 @@ function setupDotNet () {
915915 # fi
916916 fi
917917 dotnet_path=" ${dotnet_basepath} /dotnet/"
918-
919- useCustomDotNetInstallScript=false
920- # No longer using the arm64 custom script: standard install script seems good enough now.
921- # output a warning message if no admin rights and instruct user on manual steps
922- # if [ "$architecture" = 'arm64' ]; then useCustomDotNetInstallScript=true; fi
923-
924- if [ " $useCustomDotNetInstallScript " = true ]; then
918+
919+ if [ " $architecture " = ' arm64' ]; then
925920 install_instructions=" sudo bash '${installScriptsDirPath} /dotnet-install-arm.sh' $requestedNetMajorMinorVersion $requestedType "
926921 else
927922 install_instructions=" sudo bash '${installScriptsDirPath} /dotnet-install.sh' --install-dir '${dotnet_path} ' --channel $requestedNetMajorMinorVersion --runtime $requestedType "
@@ -932,7 +927,7 @@ function setupDotNet () {
932927 if [ " $os " = " linux" ]; then
933928
934929 # Potentially not reliable. Only blessed by MS for Debian >= 12
935- if [ " $os_name " = " debian" ] && [ ! " $os_vers " -lt " 12 " ]; then
930+ if [ " $os_name " = " debian" ] && [ " $os_vers " -gt " 11 " ]; then
936931
937932 if [ $verbosity = " quiet" ]; then
938933 wget https://packages.microsoft.com/config/debian/${os_vers} /packages-microsoft-prod.deb -O packages-microsoft-prod.deb > /dev/null
@@ -950,20 +945,21 @@ function setupDotNet () {
950945 sudo apt-get update && sudo apt-get install -y aspnetcore-runtime-$requestedNetMajorMinorVersion > /dev/null
951946 fi
952947
953- # .NET 9 seems to settle down the "we do/we don't" that MS is doing with .NET 6,7 and 8.
954- elif [ " $requestedNetMajorVersion " = " 9" ]; then # ... && [ "$os_name" = "ubuntu" ]
948+ # Inclusion in std Ubuntu repos is a bit of a mess:
949+ # .NET 9 is in std 24.10 repo. For 22.04 and 24.04 use backports
950+ # .NET 6 & 7, Ubuntu 24.04 use backports
951+ # Everything else use the script
952+ elif [ " $os_name " = " ubuntu" ] && [ " $requestedNetMajorVersion " = " 9" ]; then
955953
956- # TODO: Change this to a " >= 24.10"
957- if [ " $os_name " = " ubuntu" ] && [ " $os_vers " = " 24.10" ]; then
954+ if [ " $os_vers " = " 24.10" ]; then
958955 if [ " $requestedType " = " sdk" ]; then
959956 sudo apt-get update && sudo apt-get install -y dotnet-sdk-$requestedNetMajorMinorVersion > /dev/null
960957 else
961958 sudo apt-get update && sudo apt-get install -y aspnetcore-runtime-$requestedNetMajorMinorVersion > /dev/null
962959 fi
963960 else
964- # .NET 9 is still not fully released. But we know a guy who knows a guy...
965- # TODO: This also works for NET 6 & 7, Ubuntu 24.04, and .NET 9, Ubuntu 22.04 & 24.04
966961 sudo add-apt-repository ppa:dotnet/backports -y
962+ # This installs the SDK and the runtimes
967963 sudo apt install " dotnet${requestedNetMajorVersion} " -y
968964 fi
969965
@@ -973,7 +969,7 @@ function setupDotNet () {
973969 # Needed if we're installing .NET without an installer to help us
974970 installAptPackages " ca-certificates libc6 libgcc-s1 libicu74 liblttng-ust1 libssl3 libstdc++6 libunwind8 zlib1g"
975971
976- if [ " $useCustomDotNetInstallScript " = true ]; then
972+ if [ " $architecture " = ' arm64 ' ] && [ " $os_name " != " ubuntu " ]; then
977973 # installs in /opt/dotnet
978974 if [ $verbosity = " quiet" ]; then
979975 sudo bash " ${installScriptsDirPath} /dotnet-install-arm.sh" " ${requestedNetMajorVersion} .0" " $requestedType " " quiet"
0 commit comments