This tutorial explained how to install .net core on Debian 11 Linux system.
Login to your debain system with sudo privileged account.
Open a terminal, update the apt cache and install below required packages
1.Update Debian 11 ‘Bullseye’
1 2 |
sudo apt update sudo apt install apt-transport-https |
2.Enable Microsoft PPA
First, you need to enable Microsoft packages repository on your Debian system. The Microsoft official team provides a Debian packages to create PPA file on your system.
Open a terminal on your Debian system and configure Microsoft PPA by run the following commands:
1 2 |
sudo wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb |
3.Install NET Core 3.1 Runtime On Debian 11 ‘Bullseye’
The .NET Core 3.1 Runtime used for running application build on .NET Core. Open a terminal and execute below commands to install .NET Core SDK:
1 2 |
sudo apt update sudo apt install dotnet-runtime-3.1 |
4.Test
To check if the runtime is intalled and run correctly, ppen a terminal and execute below commands
1 |
dotnet --list-runtimes |
5 Conclusion
The .NET 3.1 Runtime is working
1 |
Microsoft.AspNetCore.App 3.1.32 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]<br>Microsoft.NETCore.App 3.1.32 [/usr/share/dotnet/shared/Microsoft.NETCore.App] |
6 Optional, install SDK
The steps above is to install the .NET Core 3.1 Runtime without the SDK, usually for the production server only. If you want to install the .NET Core 3.1 SDK for development machine, Open terminal and type this :
1 2 |
sudo apt update sudo apt install dotnet-sdk-3.1 |
7 Test the SDK
1 |
dotnet --info |
8 Conclusion about SDK
The SDK is installed alongside with the Runtime
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
.NET Core SDK (reflecting any global.json): Version: 3.1.426 Commit: e81f6c8565 Runtime Environment: OS Name: debian OS Version: 11 OS Platform: Linux RID: debian.11-x64 Base Path: /usr/share/dotnet/sdk/3.1.426/ Host (useful for support): Version: 3.1.32 Commit: f94bb2c3ff .NET Core SDKs installed: 3.1.426 [/usr/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.32 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.32 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download |
Reference