Installing .NET Core RC2 on Ubuntu 16.04

On https://www.microsoft.com/net/core#ubuntu there are only instructions for installing .NET Core RC2 on Ubuntu 14.04. I recently started preparing a Visual Studio Team Services build agent on Ubuntu 16.04 because version 16.04 supports running the agent as a service.  Therefore, I had to find a way to install .NET Core RC2 on Ubuntu 16.04. In this post, I will show you what you need to do. If you follow the directions for 14.04, you will eventually get this error message:

dbrown@Ubuntu1604:~$ sudo apt-get install dotnet-dev-1.0.0-preview1-002702
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 dotnet-dev-1.0.0-preview1-002702 : Depends: dotnet-sharedframework-microsoft.netcore.app-1.0.0-rc2-3002702 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Just as a reminder, I write my posts from the Linux newbie perspective. There might be some uber command I could have executed to get this to force it to download all the required files. But not being a Linux expert I followed the directions provided and was unable to get the package to install.  This is not a knock on the documentation because it was clearly written for Ubuntu 14.04 and I was attempting to install on Ubuntu 16.04.  But enough of that. Back to how I actually got it to install.  I stumbled across this solution when I got frustrated and decided to try again after I configured my build agent.  There are prerequisites I had to install for the agent that appear to enable the installation of .NET Core RC2 on Ubuntu 16.04.

Simply execute the following commands:

sudo apt-get install -y libunwind8 libcurl3

wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu52_52.1-8ubuntu0.2_amd64.deb
sudo dpkg -i libicu52_52.1-8ubuntu0.2_amd64.deb

After the commands execute, you can repeat the last step for installing .NET Core RC2:

sudo apt-get install dotnet-dev-1.0.0-preview1-002702

Now type the following command to verify .NET Core RC2 is installed:

dotnet

The output of that commmand should be:

Usage: dotnet [--help | app.dll]

Comments (6) -

  • David

    5/31/2016 11:19:55 AM | Reply

    Thank you kindly, worked like a charm.

  • Shawn

    6/2/2016 12:14:54 AM | Reply

    Thank you very much for this. I was getting frustrated trying to figure this out. This tutorial is awesome.

  • Nicolas

    6/7/2016 10:14:02 AM | Reply

    Thanks, works perfectly. It may be helpful to note that before installing dotnet via apt-get I had to add the dotnet apt-get feed as described in https://www.microsoft.com/net/core#ubuntu

    • Donovan

      6/8/2016 3:40:48 PM | Reply

      Thanks!

  • Sridhar Sathya

    6/20/2016 2:05:52 PM | Reply

    The title should have been "Installing .NET Core RC2 on Ubuntu 16.04 - the missing manual".
    Works perfect. Thanks

  • Dileep M

    7/9/2016 10:25:24 AM | Reply

    How to install on i386? Please help . Getting following error
    lsb_release -a

    No LSB modules are available.
    Distributor ID:  Ubuntu
    Description:  Ubuntu 16.04 LTS
    Release:  16.04
    Codename:  xenial



    --
    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    E: Unable to locate package dotnet-dev-1.0.0-preview1-00270
    E: Couldn't find any package by glob 'dotnet-dev-1.0.0-preview1-00270'
    E: Couldn't find any package by regex 'dotnet-dev-1.0.0-preview1-00270'
    dil@ubuntu:~$ ^C
    dil@ubuntu:~$




Add comment

Loading