Problem running dotnet on Ubuntu 14.04
Steps to reproduce
I followed the installation instructions at https://www.microsoft.com/net/core#ubuntu.
Actual behavior
Facing the following issue:
dotnet new Failed to resolve library symbol hostfxr_main, error: dotnet: undefined symbol: hostfxr_main Segmentation fault (core dumped)
Environment data
uname -a Linux ubuntu 3.19.0-61-generic dotnet/cli#69~14.04.1-Ubuntu SMP Thu Jun 9 09:09:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
dotnet --info output:
dotnet --info Failed to resolve library symbol hostfxr_main, error: dotnet: undefined symbol: hostfxr_main Segmentation fault (core dumped)
Until fixed you may usehttps://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/Latest/dotnet-dev-ubuntu-x64.latest.tar.gz
@aviviadi could you suggest solution (or loop in people who may help) for Travis failures with the same error? https://travis-ci.org/Azure/azure-sdk-for-net/builds/139079682 I've tried to fix by upgrading to dotnet-dev-1.0.0-preview2-003096 here https://github.com/Azure/azure-sdk-for-net/pull/2118 but that just went nowhere because it brought in changes that caused build failures on Windows (had to upgrade Microsoft.NETCore.App to version 1.0.0 instead of 1.0.0-rc2-* but it requires myget feed and did not really work for me).
/cc @schellap
@aviral26 but the install from the apt-get feed finished completely, yes?
Yes it did
Just reproed.
You need to have another component installed called "Host Framework Resolver". The error messaging can clearly be better here.
See installation instructions at: https://github.com/dotnet/cli#ubuntu-installers
This should produce $DOTNET_ROOT/host/fxr/1.0.1/libhostfxr.so
@schellap this also happens when installing from the apt-get feed. So this is not a manual installation.
@brthor is it because the Preview 1 packages don't have an updated dependency (if this dependency was added later, post-Preview 1 release)?
Yes this is because the old preview1 packages had a floating host dependency and the new host packages do not include hostfxr by default.
We were aware that re-enabling the deb publishing for preview2 may cause issues, but hostfxr came in so hot we did not foresee this particular issue. We need to decide on the next best step here (cc @piotrpMSFT ).
In order of relative difficulty I see these solutions:
- Wait out until preview2 is released
- Migrate our published releases (only preview1 currently) to a new feed, and point customers there.
- Hand craft a debian package with a fixed host dependency and binaries from the current preview1 package.
@brthor thanks for the explanation. Would switching over to the install script help people get Preview 1 bits in working state?
For the preview1 bits yes install scripts should work, the preview2 bits are working on ubuntu14 and ubuntu16 via apt-get (confirmed today)
Folks could consume those like so: apt-get install dotnet-dev-1.0.0-preview2-003118
@brthor can you give the command for the dotnet-install.sh script? I assume the same one as on Debian would work?
curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview1/scripts/obtain/dotnet-install.sh | bash /dev/stdin --version 1.0.0-preview1-002702 --install-dir ~/dotnet
@blackdwarf That should work yes :smile:
@aviral26 @hovsepm is this workaround good for you? You can use the above command to get the Preview 1 bits that will work for you. Of course, before this, please purge the existing apt-get installation.
using apt-get install dotnet-dev-1.0.0-preview2-003118 does not solve the issue for me. Here is the output
The specified framework 'Microsoft.NETCore.App', version '1.0.0-rc2-3002702' was not found.
- Check application dependencies and target a framework version installed at:
/usr/share/dotnet/shared/Microsoft.NETCore.App
- The following versions are installed:
1.0.0
- Alternatively, install the framework version '1.0.0-rc2-3002702'.
SUMMARY: Total: 1 targets, Passed: 0, Failed: 1.
Travis run - https://travis-ci.org/Azure/autorest/builds/139372235
@hovsepm how about the script? Can you try that one as a workaround?
@schellap @brthor this is weird, why can't it...ah, because you would need to install the shared fx that you are targeting as well?
Yes, pre-release upgrade will be done implicitly. But roll-forward to production need to be explicit at the app level.
@blackdwarf struggling with pre-requests on Travis. it asks for libunwind however I do have it installed.
@hovsepm these are the exact dependencies that we have: https://github.com/dotnet/core/blob/master/Documentation/prereqs.md. Could be you need a specific version of libunwind?
Yes it's libunwind8
I was able to work around. Here are the steps that needs to be added to .travis.yml:
addons:
apt:
packages:
- gettext
- libcurl4-openssl-dev
- libicu-dev
- libssl-dev
- libunwind8
- zlib1g
...
install:
- mkdir dotnet
- curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview1/scripts/obtain/dotnet-install.sh | bash /dev/stdin --version 1.0.0-preview1-002702 --install-dir ./dotnet
- export PATH=`pwd`/dotnet:$PATH
@brthor @blackdwarf - Thanks for help!