Install .NET Core on Ubuntu

Microsoft has really come to the party over the last couple of years with support for Linux, which is wonderful to see! To install .NET core on Ubuntu you can follow these steps:

Register the trusted Microsoft signature key

curl | gpg –dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

Register the Microsoft Product feed

On Ubuntu 17.10:

sudo sh -c 'echo "deb [arch=amd64] artful main" > /etc/apt/sources.list.d/dotnetdev.list'

On Ubuntu 17.04:

sudo sh -c 'echo "deb [arch=amd64] zesty main" > /etc/apt/sources.list.d/dotnetdev.list'

On Ubuntu 16.04:

sudo sh -c 'echo "deb [arch=amd64] xenial main" > /etc/apt/sources.list.d/dotnetdev.list'

On Ubuntu 14.04:

sudo sh -c 'echo "deb [arch=amd64] trusty main" > /etc/apt/sources.list.d/dotnetdev.list'

Install the .NET SDK

sudo apt-get install apt-transport-https
&& sudo apt-get update
&& sudo apt-get install dotnet-sdk-2.1.4

Check that .NET Core has been installed successfully with:

dotnet –version