How to Install .NET on Linux?
.NET is a free, cross-platform, open-source developer platform for building many different types of applications.
With .NET you can build various kinds of applications including :
- Web Application
- Mobile Apps
- Desktop Apps
- Games
- IOT
You can write .NET apps in one of the following languages :
- C#
- F#
- Visual basic
Downloading and Installation on Linux:
.NET can be downloaded from its official website and can be installed with the help of the following steps:
Step 1: Add the package repository to download it by running the following command :
wget https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb
Step 2: Now install .NET SDK with this command:
sudo apt-get update; \ sudo apt-get install -y apt-transport-https && \ sudo apt-get update && \ sudo apt-get install -y dotnet-sdk-6.0
Optional Step: This is an optional step to install the runtime, but you don’t need to install it if you have .NET SDK previously installed
sudo apt-get update; \ sudo apt-get install -y apt-transport-https && \ sudo apt-get update && \ sudo apt-get install -y aspnetcore-runtime-6.0
To verify the installation run the following command to check the version of the .NET SDK and runtimes
dotnet --list-sdks dotnet --list-runtimes