.NET (DotNet) is a free and open source developer platform Windows, MacOS and Linux. .NET 5 or later is a successor to old .NET Framework and previously named as .NET Core till version 3.1. So don’t confuse with names. Using this you can build any kind of applications. The latest .NET SDK comes with .NET Runtime, ASP.NET Core Runtime and .NET Desktop Runtime and it fully supports C# 9.0, F# 5.0 and Visual Basic 16.0 and later. It is released under MIT License.
Install .NET SDK on Ubuntu
You can install .NET on Ubuntu via Snap package, scripted install with install-dotnet.sh and APT package manager.
Install .NET via Snap:
Open the terminal (ctrl+alt+t) and run below command to install latest stable version of .NET on your Ubuntu system.
sudo snap install dotnet-sdk --classic
You can also use the “–channel” parameter to indicate which version to install. If you want to install .NET 5.0 exactly then use the below command.
sudo snap install dotnet-sdk --classic --channel=5.0
After the installation, run below command to register the dotnet command for the system.
sudo snap alias dotnet-sdk.dotnet dotnet
You can verify the installation by using
dotnet --list-sdks
For the complete usage manual.
dotnet --help
.NET SDK comes with all runtimes. If you want to install the runtime only then use the below command.
sudo snap install dotnet-runtime-50 --classic
sudo snap alias dotnet-runtime-50.dotnet dotnet
Install .NET via APT:
Install .NET 5.0 on Ubuntu 20.10
wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
Install .NET 5.0 on Ubuntu 20.04
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
Note: The new .NET 5 doesn’t support older version of Ubuntu. that is Ubuntu 19.10 and older.
Install .NET via install-dotnet.sh script:
Download install-dotnet.sh script
Download install-dotnet.sh script from the above download link and save it on your Downloads folder. Open the terminal app and run below commands.
cd Downloads
./dotnet-install.sh -c Current
If you want to install specific version then use the -c parameter like below.
./dotnet-install.sh -c 5.0
That’s all.