I followed the installation instructions at https://www.microsoft.com/net/core#ubuntu.
Facing the following issue:
dotnet new
Failed to resolve library symbol hostfxr_main, error: dotnet: undefined symbol: hostfxr_main
Segmentation fault (core dumped)
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)
@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:
@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!
I confirm this bug, I'm running ubuntu 14.04 64-bit. At first I installed preview 2 but I got the same issue as @hovsepm . So I removed it using apt-get, and installed all the following packages like 'sudo apt-get install
libunwind8-dev
gettext
libicu-dev
liblttng-ust-dev
libcurl4-openssl-dev
libssl-dev
uuid-dev
unzip
zlib1g
I then ran:
$ cd ~
$ 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
After this I copied the newly created ~/dotnet/dotnet folder to /opt and created a soft link in /bin using 'sudo ln -s /opt/dotnet/dotnet /bin/dotnet'. And now everything works like a dream.
@TheSalarKhan What issue did you run into with the preview2 package?
Ah I see
@hovsepm @TheSalarKhan @blackdwarf here is an alternative workaround
Install the preview2 sdk package
apt-get install dotnet-dev-1.0.0-preview2-003118
And then install the preview1 sharedframework package so your app will continue to work
apt-get install dotnet-sharedframework-microsoft.netcore.app-1.0.0-rc2-3002702
It is replicating on CentOS also.
@SavaNDragos can you provide more details? Is the error being seen on CentOS? How did you install the bits and which version of the bits you installed?
I used the steps from https://www.microsoft.com/net/core#centos to install dotnet on CentOs 7.2.
Dotnet Cli is version 1.0.0-preview2-003121.
The application I have, was builded with RC2 : 1.0.0-rc2-final.
I am deploying it on the CentOs machine and getting error:
The specified framework 'Microsoft.NETCore.App', version '1.0.0-rc2-3002702' was not found.
I see. This is a different problem. :smile: This issue outlines the problem with the host policy file which is absent because of the breaking change we introduced to the DEB packages with preview 2 of the tooling.
@SavaNDragos your error is by design because tools come with a version of the runtime & framework and your project is targeting a different one that is not on the machine. There are two potential solutions:
@SavaNDragos
Try changing the version of Microsoft.NETCore.App
in your project.json to 1.0.0
with preview2 bits installed.
Is this fixed or am I missing something here? I'm running into the same issues. Tried the work-arounds not working around....
@jdbeaver running into the same issues using the apt-get feed? We have run into an issue we are still investigating with that. In the meantime, can you try to use the install script to get the bits?
@jdbeaver does this still repro after using the fresh installation instructions on https://dot.net/core?
@blackdwarf @jdbeaver I've tried using the instructions at https://dot.net/core on fresh installs of Ubuntu 14.04 and 16.04 - no joy
A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
Decompressing 100% 5832 ms
Expanding 100% 20605 ms
Segmentation fault
Output of uname -a
:
Linux ubuntu 4.6.3-x86_64-linode70 dotnet/sdk#4283 SMP Thu Jul 7 17:35:46 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
There is a known issue with running .Net Core 1.0.0 on Linux kernel 4.6 (https://github.com/dotnet/coreclr/issues/6016), which was already fixed in master. It looks like you're running into that. Presumably, the 1.0.1 version planned for August will include this fix.
Have the same Problem ob Debian Jessie (8.5) running kernel 3.16.0-4-amd64 . It segfaults at startup
with following error: Failed to resolve library symbol hostfxr_main, error: dotnet: undefined symbol: hostfxr_main.
Despite mentioned in the known problems, installing libicu and the other pre-requisits does not solve the problem.
@kratzlo This is a separate issue, which version of dotnet did you install?
This issue seems to have splintered in a bunch of dirrections, many related to older builds. Since we've not had traction since August I'm going to close this issue. If you still have issues getting the host/pre-reqs to run please do open new issues that we can track down.
Still an issue at (Bash on Ubuntu on Windows):
Linux DESKTOP-7UQU43E 3.4.0+ dotnet/sdk#4283 PREEMPT Thu Aug 1 17:06:05 CST 2013 x86_64 x86_64 x86_64 GNU/Linux
Most helpful comment
Until fixed you may usehttps://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/Latest/dotnet-dev-ubuntu-x64.latest.tar.gz