Although this article will focus on installing .NET 5 on Ubuntu Linux, Dotnet 5 is also supported on other Linux distros such as CentOS, Red Hat Enterprise Linux, Alpine, etc.

What Is .NET 5?

The .NET framework has been in existence since 2002. At the time of its first release, the framework was only supported on the Windows operating system. Microsoft is currently responsible for the development and distribution of the framework.

Unlike the initial .NET framework, .NET 5 is a cross-platform and open-source framework. You can develop and run .NET 5 applications on other platforms such as Linux and macOS. Best of all, Dotnet 5 is modular and lightweight.

Installing .NET SDK on Ubuntu

If you want to install the .NET framework for both developing and running .NET apps, then first, you will have to install the .NET Software Development Kit (SDK), which also includes the .NET Runtime by default.

First, add the Microsoft package repository to your system’s package list. In addition, include Microsoft’s package signing key to your collection of trusted keys.

After adding the new package repository, get the latest package information from your package sources using apt.

To be able to install the .NET SDK securely via HTTPS, make sure to install the apt-transport-https package using the command below.

Then, install the .NET 5 SDK using the following command.

Alternatively, you can also install the Dotnet SDK using snap.

Learn More: How to Use Apt and Say Goodbye to Apt-get

Verifying the Installation

To check if .NET 5 has been installed successfully, you can run the following command to list available SDKs on your system. If you have multiple SDKs installed, they will all be listed here.

As mentioned earlier, when you install the .NET 5 SDK, the .NET Runtime is included by default. Verify the Runtime installation using the following command.

Developing Applications With .NET

Although .NET is easy to install and use, sometimes users bump into issues that are difficult to fix. In such situations, you can use the following command to learn more about the dotnet command and its options.

The various components in the .NET framework confuse a lot of developers. And before you start developing applications using the framework, knowing what .NET really is can be helpful.