How to install Net6 on Raspberry Pi 4

In this article I will show you how you can install .net6 on Raspberry Pi 4.

cd /home
sudo mkdir downloads
cd downloads

sudo wget
sudo wget
sudo wget

sudo mkdir ~/.dotnet
sudo tar -xvf dotnet-sdk-6.0.100-preview.3.21202.5-linux-arm.tar.gz -C ~/.dotnet
sudo tar -xvf aspnetcore-runtime-6.0.0-preview.3.21201.13-linux-arm.tar.gz -C ~/.dotnet
sudo tar -xvf dotnet-runtime-6.0.0-preview.3.21201.4-linux-arm.tar.gz -C ~/.dotnet

sudo nano ~/.bashrc

Add following rows and save (CTRL+O):
export DOTNET_ROOT=$HOME/.dotnet 
export PATH=$PATH:$HOME/.dotnet

Restart the Raspberry
sudo shutdown -r now

Now you can verify the netcore6 installation:
dotnet --version

The expected result is:



Note you can execute dotnet --info for more information. In my case the result is:

pi@raspberrypi:~ $ dotnet --info
.NET SDK (che rispecchia un qualsiasi file global.json):
 Version:   6.0.100-preview.3.21202.5
 Commit:    aee38a6dd4

Ambiente di runtime:
 OS Name:     raspbian
 OS Version:  10
 OS Platform: Linux
 RID:         linux-arm
 Base Path:   /home/pi/.dotnet/sdk/6.0.100-preview.3.21202.5/

Host (useful for support):
  Version: 6.0.0-preview.3.21201.4
  Commit:  236cb21e3c

.NET SDKs installed:
  6.0.100-preview.3.21202.5 [/home/pi/.dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0-preview.3.21201.13 [/home/pi/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0-preview.3.21201.4 [/home/pi/.dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs: