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
0 Comments