Cách cài đăt netcore Install .NET5 on Ubuntu 20.04
The process of installing the .NET5 SDK for development on Ubuntu 20.04 takes 2 steps. First we install the package repository and then we install the .NET5 SDK.
Open a shell in Ubuntu and install the Microsoft package repository using the following commands.
$ 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
Next, install the latest .NET5 SDK.
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
That’s it! You can verify .NET5 is installed using the .NET CLI. The version returned will vary as new versions of .NET5 are released.
$ dotnet --version 5.0.202
You can check the list of .NET SDKs and runtimes you have running on Ubuntu using the .NET CLI as well.
$ dotnet --list-sdks 5.0.202 [/usr/share/dotnet/sdk]
$ dotnet --list-runtimes Microsoft.AspNetCore.App 5.0.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
At this point you can develop .NET5 applications using your editor or IDE of choice. Visual Studio Code is available on Ubuntu and used by millions of developers to develop all kinds of applications using numerous programming languages. Since Visual Studio Code is developed by Microsoft, you can, of course, use it to develop .NET5 C# applications as well! As mentioned above, I am also personally fond of JetBrains Rider, which can be used to develop .NET5 applications on macOS, Linux, and Windows, too.