Skip to content

Instantly share code, notes, and snippets.

@PedroCavaleiro
Last active July 8, 2024 13:30
Show Gist options
  • Save PedroCavaleiro/a99346eafd40d7e515b685fdd6379455 to your computer and use it in GitHub Desktop.
Save PedroCavaleiro/a99346eafd40d7e515b685fdd6379455 to your computer and use it in GitHub Desktop.
Simple installer for .NET 8 for Debian. This follows the instructions on the MS website, can install the SDK, ASP Core Runtime or the Runtime without ASP support. This only installs the latest .NET 8 so only Debian 12 and 11 are supported
#!/bin/bash
echo -n "Debian Version [12 or 11]: "
read debianversion
echo -n "Install [sdk / asp / core]: "
read installer
wget https://packages.microsoft.com/config/debian/$debianversion/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
if [ $installer = 'sdk' ]; then
sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0
fi
if [ $installer = 'asp' ]; then
sudo apt-get update && sudo apt-get install -y aspnetcore-runtime-8.0
fi
if [ $installer = 'core' ]; then
sudo apt-get update && sudo apt-get install -y dotnet-runtime-8.0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment