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]