The Ubuntu 22.04 users can only install .NET Core 6.0. It doesn’t support .NET Core 3.1 or 2.0 since the distro only supports OpenSSL 3. The developers should install the .NET Core SDK on their system and the staging or production server needs the .NET Core runtime only. This tutorial walks through installing the .NET core on Ubuntu 22.04 LTS Linux system. You can install .NET Core SDK or set up the runtime environment on your system.

Step 1 – Enable Microsoft PPA

First of all, enable the Microsoft Apt repository on our Ubuntu systems. The Microsoft team provides a Debian package to set up the PPA on the Ubuntu system. Open a terminal on your Ubuntu system and configure Microsoft PPA by running the following commands: Above commands will create a /etc/apt/sources.list.d/microsoft-prod.list file in your system with the required configuration. Let’s begin the .NET core installation on the Ubuntu system.

Step 2 – Installing .NET Core SDK on Ubuntu

.NET Core SDK is the Software development kit used for developing applications. If you are going to create an application or make changes to an existing application, you will require a .net core SDK package on your system. To install .NET Core SDK on Ubuntu 22.04 LTS system, execute the following commands: Press “y” for any input prompted by the installer. That’s it. You have successfully installed .Net core SDK on your Ubuntu system.

Step 3 – Installing .NET Core Runtime on Ubuntu

.NET Core Runtime is required for the system, where you only need to run the application. For example, production or staging environments are required to run applications only. To install .NET Core Runtime only on Ubuntu 22.04 LTS system, type: Press “y” for any input prompted by the installer. That’s it. You have successfully installed the .NET core runtime on your Ubuntu system.

Step 4 – Check .NET Core Version

You can use dotnet command line utility to check the installed version of the .NET Core on your system. To check dotnet version, type: Output:Checking .NET Core Version

Step 5 – (Optional) Create a Sample Application

Let’s create a sample application with dotnet core on your Ubuntu system. Create a new console application with the command: This will create a .Net core application on your system. This will create a directory named “helloworld” under the current directory. You can change to this directory and start working on your application. Make your changes to the application and execute the below command to run this application. You will see the following output as a result.

Remove or Uninstall .NET Core on Ubuntu

In case, the .NET Core is not more required on your system. You can uninstall it from the system with the following commands. Also, remove unused packages installed as dependencies:

Conclusion

In this tutorial, you have learned to install .NET Core SDK and Runtime on a Ubuntu 22.04 LTS (Jammy Jellyfish) Linux system. Now, you may like to install Visual Studio Code or Sublime Text editor on your Ubuntu desktop systems.

How to Install  NET Core  dotnet  on Ubuntu 22 04   TecAdmin - 89How to Install  NET Core  dotnet  on Ubuntu 22 04   TecAdmin - 76