Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace.

The error with this specific error message is caused by some application or library code trying to PInvoke libdl.so directly, like this: https://github.com/Therzok/SQLitePCL.raw/blob/d86a5b5311ff4cdbba54cda49c23a776bd888663/src/cs/sqlite3_pinvoke.cs#L1255-L1257

The proper fix is change the offending code to call NativeLibrary.Load managed API that abstracts away the platforms and platform version differences in native library loading.

Linking libdl.so to libdl.so.2 is a fine workaround until the proper fix can be deployed.

Discussions

Dotnet driver v2.14.1 error: "Unable to load shared library 'libdl' or one of its dependencies"
I get Unable to load shared library 'libdl' or one of its dependencies exception when initializing the client in this specific case: .NET 6.0 MongoDB.Driver v2.14.1 Explicitly setting ZStandard or Snappy connection compression with MongoClientSettings Production build for application Running ... More on mongodb.com
🌐 mongodb.com
1
0
December 6, 2021
`dotnet restore` failes `Unable to load shared library 'libdl' or one of its dependencies`
Description DotNetRestore failes with following error message: Unable to load shared library 'libdl' or one of its dependencies. Platforms affected Azure DevOps GitHub Actions Virtual envir... More on github.com
🌐 github.com
12
August 6, 2022
mongodb - System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies - Stack Overflow
im use .net 8 with mongodb and mongoClient base on microservice getting eror like : System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies In order to help di... More on stackoverflow.com
🌐 stackoverflow.com
April 26, 2024
DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory
Read and complete the full issue template Do you want to request a feature or report a bug? Bug Feature Version of ClosedXML 0.92.1 Wh at is the current behavior? I got an exception System.DllNotFo... More on github.com
🌐 github.com
4
November 1, 2018
🌐
MongoDB
mongodb.com › working with data › drivers
MongoDB.Driver 2.17.1 with client ecryption in docker throws: "Unable to load shared library 'libdl' or one of its dependencies" - Drivers - MongoDB Community Hub
October 13, 2022 - Hi The issue I get errors while debugging ASP.NET 6 app that uses MongoDriver with client encryption in Visual Studio 2022 using docker image. aspnet:6.0 and sdk:6.0 images With these images I get the following error: Exception thrown: ‘System.DllNotFoundException’ in MongoDB.Libmongocrypt.dll: ‘Unable to load shared library ‘libdl’ or one of its dependencies.
🌐
GitHub
github.com › actions › runner-images › issues › 6029
`dotnet restore` failes `Unable to load shared library 'libdl' or one of its dependencies` · Issue #6029 · actions/runner-images
August 6, 2022 - Description DotNetRestore failes with following error message: Unable to load shared library 'libdl' or one of its dependencies. Platforms affected Azure DevOps GitHub Actions Virtual envir...
Author   actions
🌐
Stack Overflow
stackoverflow.com › questions › 78389073 › system-dllnotfoundexception-unable-to-load-shared-library-libdl-or-one-of-its
mongodb - System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies - Stack Overflow
April 26, 2024 - If you're using glibc, consider setting the LD_DEBUG environment variable: 2024-04-26 13:37:27 /app/bin/Debug/net8.0/runtimes/linux-x64/native/libdl.so: cannot open shared object file: No such file or directory 2024-04-26 13:37:27 /app/bin/Debug/net8.0/runtimes/linux/native/libdl.so: cannot open shared object file: No such file or directory 2024-04-26 13:37:27 /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.4/libdl.so: cannot open shared object file: No such file or directory 2024-04-26 13:37:27 /app/bin/Debug/net8.0/libdl.so: cannot open shared object file: No such file or directory 2024-0
🌐
GitHub
github.com › ClosedXML › ClosedXML › issues › 1056
DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory · Issue #1056 · ClosedXML/ClosedXML
November 1, 2018 - In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory at Interop.Libdl.dlopen(String fileName, Int32 flag) at System.Drawing.SafeNativeMethods.Gdip.LoadNativeLibrary() at System.Drawing.SafeNativeMethods.Gdip..cctor() System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies.
Author   ClosedXML
🌐
Stack Overflow
stackoverflow.com › questions › 67792635 › unable-to-load-shared-library-libdl-in-dotnet2-1-running-on-linux-container
.net core - Unable to load shared library 'libdl' in dotnet2.1 running on linux container - Stack Overflow
# soft link RUN ln -s /lib/x86_64-linux-gnu/libdl-2.24.so /lib/x86_64-linux-gnu/libdl.so # install System.Drawing native dependencies RUN apt-get update \ && apt-get install -y --allow-unauthenticated \ libc6-dev \ libgdiplus \ libx11-dev \ && rm -rf /var/lib/apt/lists/* ENTRYPOINT ["dotnet", "SomeProject.Api.dll"] ... Can you share the Dockerfile? Besides, here is a similar thread about using the system.Drawing in Asp.net core, you could check it and try to modify your code as below: RUN apt-get update \ && apt-get install -y --allow-unauthenticated \ libgdiplus \ # libc6-dev \ # libx11-dev \ && rm -rf /var/lib/apt/lists/*.
Find elsewhere
🌐
GitHub
github.com › GoogleCloudPlatform › google-cloud-dotnet-powerpack › issues › 22
Unable to load shared library 'libdl.so' or one of its dependencies (dotnet 5.0 support) · Issue #22 · GoogleCloudPlatform/google-cloud-dotnet-powerpack
November 12, 2020 - In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl.so: cannot open shared object file: No such file or directory at Grpc.Core.Internal.UnmanagedLibrary.Linux.dlopen(String filename, Int32 ...
Author   GoogleCloudPlatform
🌐
GitHub
github.com › confluentinc › confluent-kafka-dotnet › issues › 580
Unable to load shared library 'libdl' or one of its dependencies. · Issue #580 · confluentinc/confluent-kafka-dotnet
August 5, 2018 - { "errorType": "DllNotFoundException", "errorMessage": "Unable to load shared library 'libdl' or one of its dependencies.
Author   confluentinc
🌐
GrandNode
grandnode.com › boards › topic › 5e08a2f70e9b4e87d4385f62 › cent-os-7-dllnotfoundexception-unable-to-load-shared-library-libdl-or-one-of-its-dependencies-
Cent OS 7 : DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies ? | GRANDNODE
Hi please i have add grand to an cent os 7 and install all pkg CentOS distributions require the following libraries installed: libunwind lttng-ust libcurl openssl-libs libuuid krb5-libs libicu zlib but now when i try to upload image from admin i got an error DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies.
Top answer
1 of 1
5

TL;DR: This is a building issue with the application, the application was incorrectly built and linked against libdl.so. For Linux support, the software must be rebuilt and linked to libdl.so.2 instead.

In this specific stack trace, the crash is in the C# pythonnet stack, fixed in pythonnet >= 3.0

More Explanation:

This is the standard glibc library. It's often linked automatically when binaries are created or it's often hardcoded in specific builds (the library is used to load further libraries).

The library is libdl.so.2 in Linux distributions (Debian, RHEL, Ubuntu, etc...). It was historically libdl.so in older operating systems and Unix variants.

Both have been coexisting for a while and causing confusion:

  • On CentOS, libdl.so can be installed by sudo yum install glibc-devel
  • On Debian and Ubuntu <=20, libdl.so can be installed by sudo apt-get install libc6-dev
  • On Ubuntu >= 22, libdl.so no longer exists, it can't be installed by libc6-dev (nor gcc).

The dev glibc package is a transitive dependency of gcc. It's very common for gcc to be installed on Linux machines (developer machines and end-user machines alike), so it's very common for libdl.so to be accidentally available. It's not part of the base operating system and should not be expected to be available.

Software that have been linked to libdl.so will crash when the library is not available. It's a long standing issue. It's getting more noticeable due to Ubuntu 22 lately, it was only noticeable in containers and minimal OS install before (no gcc).

In this specific stack trace, the crash was in the C# pythonnet stack, the linking was fixed in pythonnet >= 3.0

🌐
GitHub
github.com › pythonnet › pythonnet › issues › 1422
Unable to load shared library 'libdl.so' · Issue #1422 · pythonnet/pythonnet
March 19, 2021 - ---> System.TypeInitializationException: The type initializer for 'Delegates' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Python.Runtime.Runtime' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'libdl.so' or one of its dependencies.
Author   pythonnet
🌐
GitHub
github.com › dotnet › dotnet-docker › issues › 2397
aspnet:5.0 image Unable to load shared library 'libdl.so' · Issue #2397 · dotnet/dotnet-docker
November 16, 2020 - For me it's inside the package Google.Cloud.SecretManager.V1 the error occours. So install this package in a web app and run the code var client = SecretManagerServiceClient.Create(); will provoke it
Author   dotnet
🌐
Aspose
forum.aspose.com › aspose.slides product family
AWS Lambda Exception: "Unable to Load Shared Library 'libdl'" when Generating Slide Thumbnail in C# - Free Support Forum - aspose.com
October 3, 2019 - When calling GetThumbnail() in an AWS Lambda the code fails with the below exception { "errorType": "AggregateException", "errorMessage": "One or more errors occurred. (The type initializer for 'Gdip' threw an exception.)", "stackTrace": [ "at System.Threading.Tasks.Task`1.GetResultCore(Boolean ...
🌐
Reddit
reddit.com › r/ubuntu › help!!!!
r/Ubuntu on Reddit: HELP!!!!
November 18, 2023 -

Guys,I'm trying to download a program called raptor avalonia flowchart and i really don't know what to do right now,i have tried everything i know but i cold not make it work

i downloaded the zip and then extract it,it shows off a file call "publish"

so,i click it and tried to open the file in the terminal

then i type "ls" to see the archives and tried to type everything i know "sudo","make install","make" etc etc. and did not work so i think i'm kinda fuck

please help,is for school

🌐
Stack Overflow
stackoverflow.com › questions › tagged › libdl
Newest 'libdl' Questions - Stack Overflow
It consists of the following folders: installations/ #repository where I installed all the dependencies of my code src/ ... ... I'm running a .net application that requires a reference to libdl.so System.DllNotFoundException : Unable to load shared library 'libdl.so' or one of its dependencies.
🌐
GitHub
github.com › cake-build › cake › issues › 3931
Cake fails to load native libraries on Ubuntu 22.04 · Issue #3931 · cake-build/cake
September 8, 2022 - In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory at Cake.Core.Polyfill.AssemblyHelper.LoadUnixLibrary(String path, Int32 flags) ...
Author   cake-build
🌐
MongoDB
jira.mongodb.org › browse › MONGOCRYPT-533
[#MONGOCRYPT-533] Support Linux distros using libdl.so.2
April 28, 2023 - On Debian 11 (and several other distros), the dlopen and dlsym functions reside in libdl.so.2. The dependency is in the LinuxLibrary class in bindings/cs/MongoDB.Libmongocrypt/LibraryLoader.cs · At runtime, the library throws an exception such as: System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies.