In this post, we are going to see how to install .NET on a Linux computer, and we will learn how to create and run C# applications.
As we saw in this post, one of the advantages of .NET is that it has been a great step forward in terms of convergence. Thus, it is now possible to run .NET applications on a wide variety of architectures and operating systems.
Today we are going to learn how to use .NET on a Debian-based distribution. Personally, I will use Linux Mint, but it should work with the main Debian-based Linux distros, such as the popular Ubuntu.
Installation with APT
If we don’t want to use the Snap manager, we can also use APT to install .NET. To do this, first we add the Microsoft package signing key to the list of trusted keys and add the package repository by doing,
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
Next, we can now use APT to install .NET, by running the following commands,
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
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
Installation via Snap
The easiest way to install dotnet is via the Snap package manager. This comes installed by default on several distros, including Ubuntu. In case your distribution doesn’t have it installed, you can do it simply with,
sudo apt update
sudo apt install snapd
With Snap already installed on our machine, installing .NET can be done simply by doing.
sudo snap install dotnet-sdk --classic
Check the installation
To check that the installation has been successful, we run the following command,
dotnet --version
If everything has been installed correctly, we should see the installed .NET version.
![]()
From here, we can start developing in .NET on Linux, for which I recommend starting with a simple tutorial like the one we saw in this post.

