18.04 ✔️
Installing with APT can be done with a few commands. Before you install .NET, run the following commands to add the Microsoft package signing key to your list of trusted keys and add the package repository.
Open a terminal and run the following commands:BashCopy
wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb
Install the SDK
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don’t need to install the corresponding runtime. To install the .NET SDK, run the following commands:BashCopy
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
Important
If you receive an error message similar to Unable to locate package dotnet-sdk-5.0, see the APT troubleshooting section.
Install the runtime
The ASP.NET Core Runtime allows you to run apps that were made with .NET that didn’t provide the runtime. The following commands install the ASP.NET Core Runtime, which is the most compatible runtime for .NET. In your terminal, run the following commands:BashCopy
sudo apt-get update; \ sudo apt-get install -y apt-transport-https && \ sudo apt-get update && \ sudo apt-get install -y aspnetcore-runtime-5.0
Important
If you receive an error message similar to Unable to locate package aspnetcore-runtime-5.0, see the APT troubleshooting section.
As an alternative to the ASP.NET Core Runtime, you can install the .NET Runtime, which doesn’t include ASP.NET Core support: replace aspnetcore-runtime-5.0
in the previous command with dotnet-runtime-5.0
:BashCopy
sudo apt-get install -y dotnet-runtime-5.0
Bu yazı yorumlara kapalı.