How to install .NET on Ubuntu Linux – All official installation methods

.NET (DotNet) is a free open source developer platform for Windows, MacOS, and Linux. Since .NET 5 is the successor to the older .NET Framework and was formerly known as .NET Core until version 3.1. Therefore, do not confuse it with the name. You can use it to build any kind of application. The latest .NET SDK comes with the .NET runtime, ASP.NET Core runtime, and .NET Desktop runtime, with full support for C # 9.0, F # 5.0, and Visual Basic 16.0 and later. Released under the MIT license.

Visit the official .NET website

Install .NET SDK on Ubuntu

.NET can be installed on Ubuntu via the Snap package, script installation using install-dotnet.sh, and the APT package manager.

Install .NET via snap.

Open a terminal (ctrl + alt + t) and run the following command to install the latest stable version of .NET on your Ubuntu system.

sudo snap install dotnet-sdk --classic

You can also use the “–channel” parameter to specify the version to install. If you want to install .NET 5.0 correctly, use the following command.

sudo snap install dotnet-sdk --classic --channel=5.0

After installation, execute the following command to register the dotnet command of the system.

sudo snap alias dotnet-sdk.dotnet dotnet

You can check the installation using

dotnet --list-sdks

dotnet installation

For a complete usage manual.

dotnet --help

The .NET SDK comes with all the runtimes. If you want to install only the runtime, use the following 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

Caution: The new .NET 5 does not support older versions of Ubuntu. That is, Ubuntu 19.10 or earlier.

Also read: How to install Eclipse IDE on Ubuntu

Install .NET using the install-dotnet.sh script.

download the install-dotnet.sh script

download install-dotnet.sh Create a script from the download link above download folder. Open the terminal app and execute the following command.

cd Downloads
./dotnet-install.sh -c Current

If you want to install a specific version, use the -c parameter as follows:

./dotnet-install.sh -c 5.0

that’s all.

If you like this article, subscribe YouTube channel..You can also stay connected with us twitter And Facebook..

..

Related Posts