How to install .Net Core on Ubuntu 16.04

Contents

Add the dotnet apt-get feed

In order to install .NET Core on Ubuntu, you need to first set up the apt-get feed that hosts the package you need.

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update

Install .NET Core SDK

Before you start, please remove any previous versions of .NET Core from your system by using this script.

sudo apt-get install dotnet-dev-1.0.0-preview2-003121

Initialize some code

Let’s initialize a sample Hello World application!

mkdir hwapp
cd hwapp
dotnet new

Run the app

The first command will restore the packages specified in the project.json file, and the second command will run the actual sample:

dotnet restore
dotnet run

And you’re ready!

You now have .NET core running on your machine!

Source: .Net Core on Ubuntu

Leave a Reply