Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated apt packages cause Ubuntu instructions to fail #227

Closed
jskeet opened this issue Jul 16, 2016 · 20 comments
Closed

Updated apt packages cause Ubuntu instructions to fail #227

jskeet opened this issue Jul 16, 2016 · 20 comments

Comments

@jskeet
Copy link

jskeet commented Jul 16, 2016

I first noticed this on Travis, e.g.
https://travis-ci.org/nodatime/nodatime/builds/145115426

Now having run sudo apt-get update and sudo apt-get upgrade on local Linux boxed (Ubuntu 14.04 and Ubuntu 16.04) I get the same problem.

Running dotnet restore gives an error of:

Failed to resolve library symbol hostfxr_load, error: /usr/share/dotnet/host/fxr/1.0.1/libhostfxr.so: undefined symbol: hostfxr_load
Failed to resolve library symbol hostfxr_unload, error: /usr/share/dotnet/host/fxr/1.0.1/libhostfxr.so: undefined symbol: hostfxr_unload
This executable relies on newer functionality (exports) provided by 'libhostfxr.so'
  - Updating 'libhostfxr.so' to version '1.0.2-beta-000581-00' might help resolve this problem.

It looks like this happened between 2016-07-15T15:30:00Z (my last successful Noda Time build) and 2016-07-16T10:16:00Z.

My guess is that after the weekend, there will be a lot of people noticing this...

@jskeet
Copy link
Author

jskeet commented Jul 16, 2016

Attempted to work around this:

$ sudo apt-get install dotnet-hostfxr-1.0.2
...
$ dotnet restore
error: Access to the path '/home/jon/.dbus' is denied.
error:   Permission denied

Oops.

@lejouson
Copy link

lejouson commented Jul 16, 2016

I have the same error message related to libhostfxr. In my case, after a fresh installation on Ubuntu 14.04.

$ sudo apt-get install dotnet-dev-1.0.0-preview2-003121
...
$ dotnet --version
Failed to resolve library symbol hostfxr_load, error: /usr/share/dotnet/host/fxr/1.0.1/libhostfxr.so: undefined symbol: hostfxr_load
Failed to resolve library symbol hostfxr_unload, error: /usr/share/dotnet/host/fxr/1.0.1/libhostfxr.so: undefined symbol: hostfxr_unload
This executable relies on newer functionality (exports) provided by 'libhostfxr.so'
  - Updating 'libhostfxr.so' to version '1.0.2-beta-000581-00' might help resolve this problem.

@danielcor
Copy link

I am also seeing the same issue... Got a brand new laptop running Mint 17.2, did an apt-get upgrade, and then install dot net, as well as Code.

Getting the exact same message when I type "dotnet new".

@vtomasr5
Copy link

I'm experimenting the same issue on Ubuntu 16.04 64bits.
Quick fix is downgrade to the previous version:
$apt-get install dotnet-host=1.0.2-beta-000566-00-1

@jplebre
Copy link

jplebre commented Jul 16, 2016

+1 for the exact same error on Travis CI.
@vtomasr5 did that fix the issue?

@juanram
Copy link

juanram commented Jul 17, 2016

I think that web page for Ubuntu / Linux Mint install is not up to date.

1 - Please remove any previous versions of .NET Core from your system (as told on web page...)

2 - Download and install latest version from repository (using browser)

From URL:
https://apt-mo.trafficmanager.net/repos/dotnet/pool/main/d/dotnet-dev-1.0.0-preview3-003203/
Download and install:
dotnet-sdk-ubuntu.16.04-x64.1.0.0-preview3-003203.deb

3 -From jskeet comment:

  sudo apt-get install dotnet-hostfxr-1.0.2

After that, the following worked for me (with Linux Mint 18, using the Ubuntu 16.04 repository):

mkdir hwapp
cd hwapp
dotnet new

dotnet restore
dotnet run

@jfaquinojr
Copy link

@juanram the link seems to be for ubuntu 16.04, I am on ubuntu 14.04 (Mint 17.3) so when I try to install it it says "Dependency is not satisfiable: libstdc++6..."

so I went ahead with

sudo apt-get install dotnet-hostfxr-1.0.2

and that fixed it.

.NET Command Line Tools (1.0.0-preview2-003121)
Product Information:
 Version:            1.0.0-preview2-003121
 Commit SHA-1 hash:  1e9d529bc5

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  14.04
 OS Platform: Linux
 RID:         ubuntu.14.04-x64

Thanks all.

@jskeet
Copy link
Author

jskeet commented Jul 17, 2016

@juanram: There's a broader point here though - even if preview3 is ready and available (which surprises me anyway), releasing a subset of packages which breaks anyone who has installed preview2 is a really bad idea. Ideally (IMO) anyone explicitly installing preview2 would keep preview2 anyway, but if that's not possible, the update shouldn't break them. I suspect the problem is that some packages have been released but others haven't... I don't know enough about apt to say for sure.

I don't like the idea of Travis breaking with no warning every time there's a new build available.

@vtomasr5
Copy link

@jplebre It dit because it was the only package that was updated from the repo. I was using dotnet-hostfxr-1.0.1 so I updated manually sudo apt-get install dotnet-hostfxr-1.0.2-beta-000583-00 and it solved the problem indeed.

The version (i.e. 000583-00-1) has to be the same
dotnet-host-1.0.2-beta-000583-00-1
dotnet-hostfxr_1.0.2-beta-000583-00-1

It seems to be a dependencies/packaging problem.

@aleks-sidorenko
Copy link

Got the same problem on Ubuntu 16.04 and
sudo apt-get install dotnet-hostfxr-1.0.2
fixed the problem for me too!

@juanram
Copy link

juanram commented Jul 17, 2016

@jskeet: I agree with you. Ideally, if you do a .deb package correctly, it will satisfy all dependencies (or, at least, warn about any unresolved dependency) so I think something was not done right: maybe they missed something.
By the way, when I installed preview 3 (with GDebi), it said on the Description that it was Microsoft .NET Core 1.0.0 - SDK Preview 2 ...

@jfaquinojr:
Linux Mint 17 is based on Ubuntu 14.04 'Trusty Tahr'. (I think still uses libstdc++ 5)
Linux Mint 18 is based on Ubuntu 16.04 'Xenial Xerus'. (I think already uses libstdc++ 6)
So they use different repositories with different dependencies.

In any case, I think that the people from the 'dotnet core' project should take a look at this issue.

@jplebre
Copy link

jplebre commented Jul 17, 2016

So, @aleks-sidorenko solution worked for me, if you are stuck with travis

install:
# Install .net using linux CLI commands
  - sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
  - sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
  - sudo apt-get update
  - sudo apt-get -qq install dotnet-dev-1.0.0-preview2-003121
  - sudo apt-get install dotnet-hostfxr-1.0.2

@juanram
Copy link

juanram commented Jul 17, 2016

Yeah, it seems that version 1.0.1 of:
libhostfxr.so
doesn't have the functions:
hostfxr_load
hostfxr_unload

so I removed 'previous' version (dotnet-dev-1.0.0-preview3-003203) with the script, and then
sudo apt-get autoremove
sudo apt-get autoclean

just to clean all, and then I reinstalled dot-net-dev-1.0.0-preview2-003121 as jplebre tells:

sudo apt-get install dotnet-dev-1.0.0-preview2-003121
sudo apt-get install dotnet-hostfxr-1.0.2

and it also worked for me.

Please, note that this is a PREVIEW release.

Please, remember that for Ubuntu 14.04 or Linux Mint 17 you should use before install:

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update

And for Ubuntu 16.04 or Linux Mint 18 you should use instead:

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update

bgrainger added a commit to mysql-net/MySqlConnector that referenced this issue Jul 18, 2016
@blackdwarf
Copy link

Ongoing development activity pushed a package to that feed which was incompatible with released versions of dotnet. Sorry about this. In order to resolve this, we've created a new feed called "dotnet-release" that will contain only the stable bits. It is recommended that you start using this feed in your CI scripts or on your dev machines. The getting started instructions on https://dot.net/core for Ubuntu are also being updated to reflect this.

If you are installing this on your dev machine, please make sure that you purge the previously installed package and then remove all of its dependencies using the following:

sudo apt-get purge dotnet-host
sudo apt autoremove

Here are the steps you need to do for Ubuntu 14.04:

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list' 
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
sudo apt-get install dotnet-dev-1.0.0-preview2-003121

Here are the steps you need to do for Ubuntu 16.04:

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 apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
sudo apt-get install dotnet-dev-1.0.0-preview2-003121

Note: if you happen to run into a problem with HTTPS transport when doing these steps, please be sure to install the apt-transport-https package.

bgrainger added a commit to mysql-net/MySqlConnector that referenced this issue Jul 19, 2016
ejball added a commit to Faithlife/DapperUtility that referenced this issue Jul 19, 2016
bgrainger added a commit to mysql-net/MySqlConnector that referenced this issue Jul 19, 2016
@jskeet
Copy link
Author

jskeet commented Jul 19, 2016

@blackdwarf: That's great, thanks very much. I can certainly confirm that's fixed the Noda Time build :)

@blackdwarf
Copy link

@jskeet the pleasure is all mine. :)

@yajiya
Copy link

yajiya commented Jul 20, 2016

@jskeet How to set up .net core in production env. I just searched and found how to set up .net core sdk on ubuntu. IMO, for production env, sdk is a little over weight.

@jskeet
Copy link
Author

jskeet commented Jul 20, 2016

@yajiya: That's really a question unrelated to this issue, to be honest.

@blackdwarf
Copy link

@jskeet would it be OK if we closed this issue? Seems like the core underlying issue has been addressed.

@yajiya if you are thinking about how to run apps in production, we have guidance on that: https://docs.microsoft.com/en-us/dotnet/articles/core/deploying/index.

@jskeet
Copy link
Author

jskeet commented Jul 20, 2016

Yup, will close the issue now.

@jskeet jskeet closed this as completed Jul 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants