Ubuntu - Installing .net core
Asked Answered
N

7

48

I want to try out the new .net core. I am following instructs at https://www.microsoft.com/net/core, but it is not working.

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.

I am running ubuntu 16.04.

Nerine answered 19/5, 2016 at 12:11 Comment(2)
Your only choice is to wait. Once they update the installer for 16.04 you can then try it out.Renovate
Forgot to include a link blogs.msdn.microsoft.com/dotnet/2016/05/16/… Clearly 16.04 support only comes in RTM (end of June).Renovate
P
30

UPDATED see at the end. (thanks to Prasanna)

.NET core now supports Ubuntu 14.04, 16.04, 16.10 & Linux Mint 17.

Please check the official page for all the details.

Today (May 2016) only Ubuntu 14.04 is supported.

I successfully install it on Ubuntu 15.10 by adding

deb http://security.ubuntu.com/ubuntu trusty-security main

to /etc/apt/sources-list

Once it's done you should do:

apt-get update

apt-get upgrade

and again the command

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

It will ask to install extra package; you reply yes and you are done!

Test by typing

dotnet --version

Enjoy!

UPDATED

Pius answered 20/5, 2016 at 12:8 Comment(6)
Instead of adding whole repository you can simply download and install libicu52 from Wily WerewolfPancake
I can confirm that the solution of adding a repo to the /etc/apt/sources-list also fixed it for Ubuntu 16.04Galenic
Can verify this solved the problem for me on Mint 18 Xfce x64... oh, and thanks :-)Zicarelli
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package dotnet-dev-1.0.0-preview1-002702a E: Couldn't find any package by regex 'dotnet-dev-1.0.0-preview1-002702a'Prochronism
I think it'll be good to have only link to the official page that has complete installation instructions.Bela
Keep in mind that dotnet-core is currently available only for 64bit linux distros. 32bit is under construction and you can track the progress here.Monroe
B
17

Now .NET core supports ubuntu 16.04.

Please check link for more details

https://www.microsoft.com/net/core#linuxubuntu

You need to setup the apt-feed first for ubuntu 16.04.

Remove previous .net core versions from your system if any

Then install .net core sdk

Baeda answered 28/6, 2016 at 14:52 Comment(1)
As of today it is supporting Ubuntu 17.10 as well.Retrad
H
16

September 2018 - .NET Core installation is super simple on Ubuntu:

Register the Microsoft key, product repository, and install required dependencies:

IMPORTANT NOTE: change the 18.04 in the below path to your Ubuntu version (i.e.: 17.10, 16.04 etc.)

wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

Now update list of available packages and install your SDK

sudo apt-get update
sudo apt-get install dotnet-sdk-2.1

Done!

Additional info:

For me (end of Sep 2018) it was version 2.1, but you can check for more recent versions like this:

sudo apt-cache search dotnet-sdk

Also please NOTE: Microsoft on their official page (here) recommend use sudo apt-get install apt-transport-https before installing dotnet-sdk-your_version. This is not required anymore because (from package description):

Description-en: transitional package for https support This is a dummy transitional package - https support has been moved into the apt package in 1.5. It can be safely removed.

So feel free to skip this.

Harlem answered 27/9, 2018 at 17:41 Comment(1)
If all else fails you can manually add the repository and key.Stagger
J
3

I am in the same boat. I want to try it without all this installation hassle. I went the docker route and found it much simpler to get up and running. Also, its much easier to clean up after trying it out since all I need to do is remove the container + image.

Another reason I went this route is because I am using Ubuntu 15.10 which is not officially compatible with a .Net Core install for Ubuntu. So instead of upgrading my distro to "try" this out, docker was a better route.

I ran it in an interactive shell, so that I can run my code:

docker run -it --name dotnet -v /home/me/tmp/:/tmp/project microsoft/dotnet /bin/bash

.. then just write some sample code using a text editor in my /home/me/tmp dir and when I want to run it, I just go to the container shell and do dotnet run.

See:

https://github.com/dotnet/dotnet-docker

https://www.microsoft.com/net/core#dockercmd

Jacquie answered 29/10, 2016 at 1:33 Comment(0)
P
2

Trying to install the dependant package dotnet-sharedframework-microsoft.netcore.app will get you next error, saying that this package depends on libicu52 but it is not installable

http://packages.ubuntu.com/pl/trusty/amd64/libicu52/download

and download .deb package. Now, go to the download location and install the package by running:

sudo dpkg -i libicu52_52.1-3ubuntu0.4_amd64.deb

Now, you will be able to run the following commands:

sudo apt-get install dotnet-sharedframework-microsoft.netcore.app-1.0.0-rc2-3002702
sudo apt-get install dotnet-dev-1.0.0-preview1-002702

dotnet --version

Good luck

source: http://zablo.net/blog/post/run-and-debug-asp-net-core-rc2-ubuntu-16-04

Parlance answered 7/7, 2016 at 7:36 Comment(0)
C
0

I also got same problem. I checked out many solutions. But they didn't work. Finally i discovered i have followed their 'Ubuntu 16.10' instruction instead of 'Ubuntu 16.04'. There was bit difference between them. Make sure you have followed correct instruction.

Cadi answered 10/6, 2017 at 3:59 Comment(0)
H
0

This package depends on libicu52. You will need to download the .deb package from the following url.

> http://packages.ubuntu.com/pl/trusty/amd64/libicu52/download

Now, install it using the following command.

> sudo dpkg -i libicu52_52.1-3ubuntu0.4_amd64.deb

You can install the .net core with this command.

> apt-get install dotnet-dev-1.0.0-preview1-002702a

Check the version which you have installed.

> dotnet --version
Hayfield answered 2/12, 2017 at 5:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.