Core: Can not install RC3 on Ubuntu 16.10

Created on 14 Feb 2017  路  15Comments  路  Source: dotnet/core

I can not install RC3 on my Ubuntu 16.10.
It says dotnet-sharedframework can not be installed so can not install dotnet.

All 15 comments

Are you trying to install the the deb packages? Are you doing them in order? Which instructions are you trying to follow?

I tried to install with following commands as available on Readme

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 hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
sudo apt-get update
sudo apt-get install dotnet-dev-1.0.0-rc3-004530

Now the problem is its for xenial and I have yakkety so its not installing.
I tried install full tar file and done following

sudo mkdir -p /opt/dotnet
sudo tar zxf [tar.gz filename] -C /opt/dotnet
sudo ln -s /opt/dotnet/dotnet /usr/local/bin

But still dotnet command gives error

Whats the error you get when you run dotnet? Which tar.gz did you download?

There are yakkety instructions here: https://www.microsoft.com/net/core#linuxubuntu

dotnet core works fine but asp.net is giving me error.
I generated project with yeoman and used dotnet restore but it couldnt find project file with .json extension. So someone on StackOverflow told me to download RC3 from github. I downloaded according to instructions on Readme page. Then I downloaded tar file for Ubuntu 16.04 and unpacked it in /opt/dotnet and made a link. Still dotnet not running.

I downloaded tar file from https://go.microsoft.com/fwlink/?linkid=839636. Its for 16.04 because 16.10 not available.

I get following error. Its after tar file installation. Previously dotnet was running fine.
screenshot from 2017-02-14 11-55-30

I think I see what's going on. It doesn't look like there is a 16.10 SDK available. I'm not sure what the plan is there. I'm following up on that.

The best I can suggest is that we could hack together an SDK from and sdk tar.gz and combine it with a Runtime from a 16.10 runtime tar.gz. Let me get a little more info and then get back to you.

@Petermarcu sure

I haven't actually tested this but here is something you can try. The premise here is that there is a runtime that runs there and you have to trick the .NET Core SDK to run on it.

Take the runtime archive from here:
https://go.microsoft.com/fwlink/?LinkID=835024

Then get the sdk archive here:
https://go.microsoft.com/fwlink/?linkid=841687

Copy the runtime into the sdk by doing this:

Copy the contents out of shared\Microsoft.NETCore.App\1.1.0 folder in the runtime archive into two places in the sdk archive:

shared\Microsoft.NETCore.App\1.1.0
shared\Microsoft.NETCore.App\1.0.3

That should work. If it doesn't, also do the same thing for the host folder copying the host\fxr\1.1.0\ contents into both the host\fxr\1.1.0\ and host\fxr\1.0.1\ folders in the sdk

This effectively makes it so you will be using a runtime that supports Ubuntu 16.10 to power the SDK tooling.

As I said, I don't have a 16.10 machine handy to try this but its similar to other steps I've followed to get things working in other places where the SDK isn't.

Ok I will try and let you know. Thank you.

Yes, its working now @Petermarcu.

Thank you so much.

I really liked new rc4.

Now console application is very clean with two files only.

Also I dont need yeoman to generate MVC app.
dotnet new mvc generates full MVC Web app. dotnet run just gives me full application running at http://localhost:5000 and thats it. Its just amazing that after 15 years, I can run my dotnet on Linux.

Thank you again.
screenshot from 2017-02-14 19-26-13

Woo hoo!

I already had 1.0.0-preview2-1-003177 installed on Ubuntu 16.10 and wanted to update to the latest bits. Found your answer and was able to get it to work for me. Here is what I did:

  • Downloaded rc4 sdk linked in your answer
  • Extracted to local folder ~/Downloads/dotnet-dev-ubuntu-x64.1.0.0-rc4-004771/
  • Copied 1.0.0-rc4-004771 folder from ~/Downloads/dotnet-dev-ubuntu-x64.1.0.0-rc4-004771/sdk/ to /usr/share/dotnet/sdk/ folder
  • PROFIT!!

Sample dotnet --info run:

$ dotnet --info
.NET Command Line Tools (1.0.0-rc4-004771)

Product Information:
 Version:            1.0.0-rc4-004771
 Commit SHA-1 hash:  4228198f0e

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  16.10
 OS Platform: Linux
 RID:         ubuntu.16.10-x64
 Base Path:   /usr/share/dotnet/sdk/1.0.0-rc4-004771

@Petermarcu provided a working solution. @Van-Dame's helpful re-phrasing unfortunately only helps half-way (dotnet run won't work). I'll contribute with some raw commands under Ubuntu 16.10.

cd ~/Downloads

Take the runtime archive from here:
https://go.microsoft.com/fwlink/?LinkID=835024

wget -O runtime.tar.gz https://go.microsoft.com/fwlink/?LinkID=835024
mkdir -p runtime && tar -xzvf runtime.tar.gz -C runtime/

Then get the sdk archive here:
https://go.microsoft.com/fwlink/?linkid=841687

wget -O sdk.tar.gz https://go.microsoft.com/fwlink/?linkid=841687
mkdir -p sdk && tar -xzvf sdk.tar.gz -C sdk/

Copy the contents out of shared\Microsoft.NETCore.App\1.1.0 folder in the runtime archive into two places in the sdk archive:

shared\Microsoft.NETCore.App\1.1.0
shared\Microsoft.NETCore.App\1.0.3

cp -r runtime/shared/Microsoft.NETCore.App/1.1.0/* sdk/shared/Microsoft.NETCore.App/1.0.3
cp -r runtime/shared/Microsoft.NETCore.App/1.1.0/* sdk/shared/Microsoft.NETCore.App/1.1.0

Copy [...] to /usr/share/dotnet/sdk/ folder (Van-Dame)

sudo cp -r sdk/1.0.0-rc4-004771 /usr/share/dotnet/sdk
sudo cp -r sdk/shared /usr/share/dotnet/
sudo chmod -R +r /usr/share/dotnet/shared
sudo chmod -R +r /usr/share/dotnet/sdk/1.0.0-rc4-004771

That should work. If it doesn't, also do the same thing for the host folder copying the host\fxr\1.1.0\ contents into both the host\fxr\1.1.0\ and host\fxr\1.0.1\ folders in the sdk

cp -r runtime/host/fxr/1.1.0/* sdk/host/fxr/1.0.1
cp -r runtime/host/fxr/1.1.0/* sdk/host/fxr/1.1.1
sudo cp -r sdk/host/fxr /usr/share/dotnet/host/
sudo chmod -R +r /usr/share/dotnet/host/fxr

Now you should be able to do the following in succession..

dotnet --version (should yield 1.0.0-rc4-004771)
mkdir test
cd test
dotnet new console
dotnet restore
dotnet build
dotnet run

Additionally if anyone runs into a problem in Visual Studio Code that no imports can be found using the below template:

using System;

namespace testproject
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

The solution for me was to (strangely) do the following:

  • Modify testproject.csproj netcoreapp1.0 to netcoreapp1.1
  • Do dotnet build in terminal
  • Modify testproject.csproj netcoreapp1.1 back again to netcoreapp1.0

Not sure why this works even though I tried dotnet new several times, but it just did. Maybe something with the templating files not running with 1.1.0/RC4...?

Also not sure if I should let it be at netcoreapp1.1, because it seems I can't install some packages via dotnet add package ... depending on the version.

Was this page helpful?
0 / 5 - 0 ratings