受欢迎的博客标签

In this post we will be installing Microsoft .net  SDK  on Ubuntu Linux and create high performance HTTP end-point in C# on which you can build a micro-service (or anything else).

 

step 1:

Create a directory to use for the download location and change into that directory. For example .

# mkdir $HOME/dotnet_install 
cd $HOME/dotnet_install

output:

root@vultr:~/dotnet_install

step 2:

Open a terminal and run the following commands:

root@vultr:~/dotnet_install# curl -H 'Cache-Control: no-cache' -L https://aka.ms/install-dotnet-preview -o install-dotnet-preview.sh

output:

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  6356  100  6356    0     0   9067      0 --:--:-- --:--:-- --:--:-- 16682

step 3:Run the script

root@vultr:~/dotnet_install# sudo bash install-dotnet-preview.sh

output:

*** Checking required system dependencies for detected OS: Ubuntu 18.04.4 LTS ...
***     tar is already installed.
***     gzip is already installed.
*** Setting package type to deb.
*** Download source: dotnet-5.0.0-preview.3-deb.tar.gz
*** Downloading https://dotnetcli.blob.core.windows.net/dotnet/release/install-preview/5.0.0-preview.3/dotnet-5.0.0-preview.3-deb.tar.gz to /root/dotnet_install ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 84.0M  100 84.0M    0     0  11.8M      0  0:00:07  0:00:07 --:--:-- 13.8M
*** Unpacking dotnet-5.0.0-preview.3-deb.tar.gz ...
...
Runtime Environment:
 OS Name:     ubuntu
 OS Version:  18.04
 OS Platform: Linux
 RID:         ubuntu.18.04-x64
 Base Path:   /usr/share/dotnet/sdk/5.0.100-preview.3.20216.6/

Host (useful for support):
  Version: 5.0.0-preview.3.20214.6
  Commit:  b037784658

.NET SDKs installed:
  3.1.201 [/usr/share/dotnet/sdk]
  5.0.100-preview.3.20216.6 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.0-preview.3.20215.14 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0-preview.3.20214.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]


Here's what the script does.

Detects the distribution and version. If it's in the 5.0 Supported OS list, the script will continue.
Determines if additional system dependencies or utilities are needed to successfully complete and install them. For example tar is used to unpack that installer packages.
Downloads the tar.gz containing the .NET preview installer packages for the detected distribution.
Downloads the system dependency installer, if needed.
Expands the tar.gz into ./dotnet_packages
Attempts to install the contents of ./dotnet_packages using rpm or dpkg, as appropriate, for the detected distribution.

dotnet-runtime-5.0:If only the .NET Core Runtime is needed, install dotnet-runtime-5.0 using your package manager.

aspnetcore-runtime-5.0: If you also need ASP.NET Core functionality, installing aspnetcore-runtime-5.0 will install both the ASP Runtime and .NET Core Runtime.

 

 

 

https://github.com/dotnet/core/blob/master/release-notes/5.0/preview/5.0.0-preview.4-install-instructions.md

https://github.com/dotnet/core/blob/master/release-notes/5.0/preview/5.0.0-preview.3-install-instructions.md