.NET (dotnet) on Raspberry Pi
What is it and why use it?
Dotnet is a development platform created by Microsoft that lets you build applications in C# and run them on Windows, Linux, and macOS. I mention it because I work professionally as a .NET Developer, and some of the guides published on this blog will be based on this language :) Another thing worth remembering is that Raspberry Pi was created mainly as an educational tool, so it makes sense to use its potential to learn C# programming, which I strongly encourage.
Download the required files
Unfortunately, you cannot install the environment in the usual way through apt. You need to download the files manually, extract them, and configure everything.
First, download the latest version. To do this, go to https://dotnet.microsoft.com/en-us/download/dotnet/6.0 and, on the right-hand side, select the SDK and Runtime binaries for Linux, ARM 32-bit. Unfortunately, even though Raspberry Pi 3 and 4 have 64-bit processors, the Raspbian system does not support them in this mode. Fortunately, the 32-bit version is still available and works very well.
Cancel the download that starts. We are only interested in the direct links, which we will use to download the archives directly to the device. You can find them in the "Direct link" field.
Now let's move to the console on the Raspberry Pi. We will download the files whose links we obtained in the previous step using wget. Enter the following commands in the console:
wget pierwszy_link
wget drugi_linkInstallation
Let's create a folder where we will extract the files.
mkdir dotnet-arm32Then extract them into it.
tar zxf dotnet-sdk-6.0.101-linux-arm.tar.gz -C $HOME/dotnet-arm32
tar zxf aspnetcore-runtime-6.0.1-linux-arm.tar -C $HOME/dotnet-arm32To check that everything works correctly, enter the following in the console:
$HOME/dotnet-arm32/dotnetYou should see the following output:
Because typing the full path every time can be inconvenient, let's add it to an environment variable so that you only need to type "dotnet" in the console. To do this, enter the following commands:
export DOTNET_ROOT=$HOME/dotnet-arm32
export PATH=$PATH:$HOME/dotnet-arm32Now, when you type "dotnet" in the console, you will get the same result as when running the command with the full path.
Comments (0)
No comments yet.
Add a comment
Comments are published after moderation. Your e-mail address stays private.