3

I installed .NET Core 2.1.4 by instructions: https://learn.microsoft.com/ru-ru/dotnet/core/linux-prerequisites?tabs=netcore2x#install-net-core-for-centos-71-64-bit--oracle-linux-71-64-bit

Next i ran dotnet --version and it shows:

Failed to resolve library symbol hostfxr_main_startupinfo, error: /usr/share/dotnet/host/fxr/2.0.5/libhostfxr.so: undefined symbol: hostfxr_main_startupinfo 2.1.4

Why did it happen so?

Mikhail
  • 357
  • 1
  • 3
  • 17

1 Answers1

5

The problem is the yum install dotnet-sdk-2.0.0 pulls in dotnet-runtime-deps-2.1.0-preview2-26406-04 (preview version instead of release).

To fix it you need to add line exclude=*preview* into dotnetdev.repo file. Or just run the following command on the second step from instruction:

sudo sh -c 'echo -e "[packages-microsoft-com-prod]\nname=packages-microsoft-com-prod \nbaseurl=https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc\nexclude=*preview*" > /etc/yum.repos.d/dotnetdev.repo'

The source: https://github.com/dotnet/core-setup/issues/4007#issuecomment-380685340

zandroid
  • 608
  • 7
  • 7
  • Yes, it is a solution. After that I ran `yum list dotnet-runtime*` and it showed runtimes list. It marked preview version in red. I removed it via `yum remove`. – Mikhail Apr 13 '18 at 09:12