How to install .NET on Ubuntu (including WSL2)
· One min read
Reference: Install .NET on Linux without using a package manager - .NET | Microsoft Learn
Download the install script
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
Make the install script executable
chmod +x ./dotnet-install.sh
Install the dot.net SDK
./dotnet-install.sh
To install the latest version
./dotnet-install.sh --version latest
Add to path
Open $HOME/.bashrc and add the following:
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
