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’

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:

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:

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

dotnet --list-runtimes

5 Conclusion

The .NET 3.1 Runtime is working

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]

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 :

sudo apt update 
sudo apt install dotnet-sdk-3.1 

7 Test the SDK

dotnet --info 

8 Conclusion about SDK

The SDK is installed alongside with the Runtime


.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

Leave A Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.