Skip to content

How to Install .NET 8.0 on Debian 11 Bullseye Linux

Advertisement

This guide will help you install .NET 8.0 on your Debian 11 Bullseye Linux system. .NET is a free, open-source platform for building many kinds of applications. Installing it on Debian 11 is straightforward if you follow these steps. Let’s get started!

Steps to Install .NET on Debian 11

This article will help you to install .NET 8 on Debian 11, a popular Linux distribution known for its stability and security.

Prerequisites

Before we begin, make sure you have:

  • A system running Debian 11.
  • A user account with sudo privileges.
  • An internet connection.

Step 1: Update Your System

First, update your system to ensure all packages are current. Open a terminal and run the following commands:

sudo apt update
sudo apt upgrade -y

Step 2: Install Required Dependencies

.NET Core requires some dependencies to run. Install them by running:

sudo apt install -y apt-transport-https ca-certificates gnupg

Step 3: Add Microsoft Package Repository

Next, you need to add the Microsoft package repository to your system. This will allow you to download and install .NET 8.

  1. Download the Microsoft signing key:
    wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
    
  2. Install the downloaded package:
    sudo dpkg -i packages-microsoft-prod.deb
    
  3. Update the package list:
    sudo apt update
    

Step 4: Install .NET SDK

Now, you can install the .NET SDK. The SDK includes everything you need to build and run .NET applications.

  1. Install the .NET SDK:
    sudo apt install -y dotnet-sdk-8.0
    
  2. Verify the installation:
    dotnet --version
    

    You should see the version number of .NET 8 displayed.

Step 5: Install .NET Runtime (Optional)

If you only need to run .NET applications, you can install just the runtime.

  1. Install the .NET Runtime:
    sudo apt install -y dotnet-runtime-8.0
    
  2. Verify the runtime installation:
    dotnet --list-runtimes
    

    This command should list the installed runtimes, including .NET 8.

Step 6: Create a Simple .NET Application

Let’s create a simple .NET application to verify that everything is working correctly.

  1. Create a new console application:
    dotnet new console -o dotnet-app
    
  2. Navigate to the application directory:
    cd dotnet-app
    
  3. Run the application:
    dotnet run
    

    You should see the output “Hello, World!” in your terminal.

Conclusion

Congratulations! You have successfully installed .NET 8 on Debian 11. You are now ready to start building and running .NET applications. If you encounter any issues, refer to the official .NET documentation for more help.

Rahul

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Leave a Reply

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


Back to top