`dotnet new command` in openSuse causes `No usable version of the libssl was found` error

末鹿安然 提交于 2019-12-11 05:13:40

问题


I'm trying to develop .NET Core in openSuse. I did install the SDK and everything in tutorials. Now, when I try to run dotnet new console command, I get this error:

No usable version of the libssl was found

Aborted (core dumped)

I found this answer: (.NET Core 2.1 SDK Linux x64 No usable version of the libssl was found), but didn't get what should I do to solve problem. They seems are deep-linuxer (which I'm not, I'm just trying to learn linux). Have any idea how to run the command?

UPDATE: System info:

openSUSE Leap 15.0

Kernel Version 4.12.14-lp150.12.22-default

OS Type:64-bit


回答1:


Can you install the libopenssl1_0_0 packages? .NET Core should pick it up and use it.

A slightly longer explanation for anyone who is curious:

OpenSSL is one of the most common cryptographic libraries used on Linux. It has multiple versions. Version 1.0 is kind of old, but heavily used. 1.1 is the newer version that was (relatively) recently released. 1.0 and 1.1 are not compatible. An application that expects 1.0 can not build against 1.1, nor run against it.

.NET Core 2.1, and all earlier versions only support OpenSSL 1.0.

Many Linux distributions are starting to make OpenSSL 1.1 the new default. But most of them still have a package for 1.0. So you just need to find and install that. On Fedora it's compat-openssl10. For openSuSE, it's libopenssl1_0_0. Then .NET Core will find it, pick it up and use it automatically.

Edit: As of March 2019, this shouldn't be required. We have updated .NET Core 2.1 and later to pick up and work with either OpenSSL 1.1 or 1.0 (whatever is available). So this problem should no longer happen with recent releases of .NET Core.




回答2:


Still get this on Fedora 30 (with compat-openssl10 installed) when using the sqlpackage tool (https://docs.microsoft.com/en-us/sql/tools/sqlpackage-download?view=sql-server-2017).

$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.2.203
 Commit:    e5bab63eca

Runtime Environment:
 OS Name:     fedora
 OS Version:  30
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/2.2.203/

Host (useful for support):
  Version: 2.2.4
  Commit:  f95848e524

.NET Core SDKs installed:
  2.2.203 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Dotnet works fine on it's own. But running sqlpackage does not work:

$ sqlpackage /tsn:localhost /tu:xx /tp:yyy /A:Import /tdn:mydb /sf:mydb.bacpac
Importing to database 'mydb' on server 'localhost'.
No usable version of the libssl was found
Aborted (core dumped)



回答3:


I looking up "No usable version of the libssl was found" in github. You'll find many variants of the .Net core security library in C, each varient has very specific dll loads for exact libssl libraries and everything has to match perfect despite it being named differently in many.

For raspberry pi / debian it wants libssl 1.0.2 exactly, nothing else.

sudo apt-get install libssl1.0.2

should do the trick for the pi! I can't speak to other variants.



来源:https://stackoverflow.com/questions/53139591/dotnet-new-command-in-opensuse-causes-no-usable-version-of-the-libssl-was-fou

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!