How To Install .NET in ubuntu



To install .NET on Ubuntu, you can follow these steps:

Step 1: Update the Package Index

Open a terminal and run the following command to update your package index:

sudo apt update


Step 2: Install Required Packages

You'll need to install some prerequisites:

sudo apt install -y wget apt-transport-https


Step 3: Download and Register the Microsoft GPG Key

Add the Microsoft package signing key to your list of trusted keys:

wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb

sudo dpkg -i packages-microsoft-prod.deb


Step 4: Install the SDK or Runtime

You can install either the .NET SDK or just the runtime. Here’s how to do both:

For .NET SDK:

sudo apt update
sudo apt install -y dotnet-sdk-8.0


For .NET Runtime:

If you only need the runtime, use this command:

sudo apt update
sudo apt install -y dotnet-runtime-8.0


Step 5: Verify the Installation

To verify that .NET is installed correctly, run:

dotnet --version


This should display the version of .NET you installed.

Adjust the version numbers in the installation commands if you want a different version (e.g., 7.0 instead of 8.0).

You can find more information and the latest versions on the official .NET documentation site.




Post a Comment

0 Comments