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 https://packages.microsoft.com/keys/microsoft.asc | 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] https://packages.microsoft.com/repos/microsoft-ubuntu-artful-prod artful main" > /etc/apt/sources.list.d/dotnetdev.list'

On Ubuntu 17.04:

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-zesty-prod zesty main" > /etc/apt/sources.list.d/dotnetdev.list'

On Ubuntu 16.04:

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'

On Ubuntu 14.04:

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod 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