Ubuntu 16.04 x64 に .NET Core SDK 2.2 をインストールする

Ubuntu 16.04 x64 に .NET Core SDK 2.2 をインストールする

参考にしたサイトはこちら
Install .NET Core SDK on Linux Ubuntu 16.04 x64

・適当な dir で
$ wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
$ sudo dpkg -i packages-microsoft-prod.deb
 
$ ls /etc/apt/*/* (以下が追加される)
/etc/apt/sources.list.d/microsoft-prod.list
/etc/apt/trusted.gpg.d/microsoft-prod.gpg

$ sudo apt-get install apt-transport-https
$ sudo apt-get update
$ sudo apt-get install dotnet-sdk-2.2
 
インストール後


$ dotnet --info
.NET Core SDK (global.json を反映):
Version: 2.2.103
Commit: 8edbc2570a

ランタイム環境:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/2.2.103/

Host (useful for support):
Version: 2.2.1
Commit: 878dd11e62

.NET Core SDKs installed:
2.2.103 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

以下 動作を試してみる
$ sudo apt install nuget
$ mkdir /path/to/samp001
$ cd samp001
$ dotnet new mvc -au None

$ dotnet publish -c Release -r ubuntu.16.04-x64 samp001.csproj
$ dotnet ./bin/Release/netcoreapp2.2/ubuntu.16.04-x64/publish/samp001.dll

Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.

ブラウザで https://localhost:5001 にアクセスして動作を確認する