Julia "could not load library" in CI
A package tried to dlopen a native shared library at load time and the dynamic linker could not find or open it. The binary artifact is missing, the runner lacks a system library it links against, or the path is wrong.
What this error means
Loading a package fails with "ERROR: could not load library ..." or "ERROR: LoadError: could not load library ... cannot open shared object file: No such file or directory".
ERROR: LoadError: could not load library "/root/.julia/artifacts/abc/lib/libfoo.so"
libstdc++.so.6: cannot open shared object file: No such file or directoryCommon causes
A missing system library on a slim image
The package binary links against a system library (libstdc++, libgomp) that a minimal runner image does not install.
A broken or partial artifact download
A JLL artifact failed to download fully, so the shared object it provides is missing or corrupt.
How to fix it
Install the missing system library
Add the OS package that provides the shared object the loader could not find, then re-run.
sudo apt-get update
sudo apt-get install -y libstdc++6 libgomp1Rebuild and reinstantiate the project
- Clear and re-instantiate so artifacts are re-fetched.
- Run Pkg.build to relink binary dependencies.
- Re-run the load.
julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.build()'How to prevent it
- Install required system libraries before loading native packages.
- Cache the Julia artifact store so binaries are not re-fetched.
- Use a runner image that includes common C/C++ runtimes.