Ubuntu - Installing .net core
Solution 1
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
Solution 2
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
Solution 3
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.
Solution 4
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
Solution 5
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
Related videos on Youtube
onurhb
Updated on September 29, 2020Comments
-
onurhb over 3 years
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.
-
Lex Li almost 8 yearsYour only choice is to wait. Once they update the installer for 16.04 you can then try it out.
-
Lex Li almost 8 yearsForgot to include a link blogs.msdn.microsoft.com/dotnet/2016/05/16/… Clearly 16.04 support only comes in RTM (end of June).
-
-
Radek Micek almost 8 yearsInstead of adding whole repository you can simply download and install libicu52 from Wily Werewolf
-
Stoyan Dimov almost 8 yearsI can confirm that the solution of adding a repo to the
/etc/apt/sources-list
also fixed it for Ubuntu 16.04 -
Adam Houldsworth over 7 yearsCan verify this solved the problem for me on Mint 18 Xfce x64... oh, and thanks :-)
-
Mansuu.... over 7 yearsReading 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'
-
Sieva Kimajeŭ over 7 yearsI think it'll be good to have only link to the official page that has complete installation instructions.
-
Horizon almost 7 yearsKeep in mind that dotnet-core is currently available only for 64bit linux distros. 32bit is under construction and you can track the progress here.
-
RBT over 6 yearsAs of today it is supporting
Ubuntu 17.10
as well. -
absynce over 5 yearsIf all else fails you can manually add the repository and key.