My OS is Arch Linux x86_64 5.2.9-arch1-1-ARCH.
I installed julia 1.2.0 from archlinux official repositories
# pacman -S julia
but when i ran julia and tried to update the packages
$ julia
]update
it came an error, i looked it up and simply followed this issue
i deleted the entire dictionary ~/.julia/registries/General/
$ rm -rf ~/.julia/registries/General/
then, i went back to update the packages again:
$ julia
]update
it came a error like this:
(v1.2) pkg> update
Cloning default registries into `~/.julia`
Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: could not load library "libgit2"
libcurl.so.4: ELF load command address/offset not properly aligned
Stacktrace:
[1] #up#43(::Pkg.Types.UpgradeLevel, ::Pkg.Types.PackageMode, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.up), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /build/julia/src/julia-1.2.0/usr/share/julia/stdlib/v1.2/Pkg/src/API.jl:149
[2] up at /build/julia/src/julia-1.2.0/usr/share/julia/stdlib/v1.2/Pkg/src/API.jl:143 [inlined]
[3] do_up!(::Dict{Symbol,Any}, ::Array{Pkg.Types.PackageSpec,1}, ::Dict{Symbol,Any}) at /build/julia/src/julia-1.2.0/usr/share/julia/stdlib/v1.2/Pkg/src/REPLMode.jl:483
[4] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:789
(v1.2) pkg>
I tried to find the answer from the internet, but i couldn't find anything useful.
so i had to solve it myself, and did this:
~ $ ldd /usr/lib/julia/libgit2.so
/usr/lib/julia/libgit2.so: error while loading shared libraries: libcurl.so.4: ELF load command address/offset not properly aligned
i don't know how it means,
but i thought the problem was in the libgit2.so file,
so i just linked it with the system's libgit2.so, and did this:
# ln -sf /usr/lib/libgit2.so /usr/lib/julia/libgit2.so
and it worked, no more errors show up.
Please use the official binaries rather than those provided by system package managers. Is this reproducible using the official binaries?
I have reported this issue on the Arch Linux bug tracker: https://bugs.archlinux.org/task/63536
Let's figure out what the cause of this issue is.
Another Arch user there,
@ararslan The official binaries work fine---I checked. It's a problem with the file Make.user in the Arch package. @goggle You have to download all files from https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/julia
and set line 11 of Make.user to
override USE_SYSTEM_LIBGIT2 = 1
I recompiled and voil脿. Unfortunately I deleted the registry instead of renaming (found the same link as @goggle ... and I leave on the edge) so julia thinks I don't have any packages installed. Renaming the environment from path/to/julia/conf/environments/v1.1 to path/to/julia/conf/environments/v1.2
sorted things out.
@ararslan I know this ticket is closed but I have this error but produced by different way. In a ipynb file I called this code:
using Pkg; Pkg.add(PackageSpec(url="https://github.com/xxx/yyy.jl"));
on github, nbviewer.jupyter.org or on my own jupyter-lab which produced the error:
error compiling #add_or_develop#13: error compiling shred!: error compiling #26: error compiling with: error compiling #27: could not load library "libgit2"
/usr/lib/x86_64-linux-gnu/libmbedx509.so.0: undefined symbol: mbedtls_mutex_unlock
Stacktrace:
[1] #add_or_develop at ./none:0 [inlined]
[2] #add_or_develop#12 at /build/julia-wJr69F/julia-1.0.3+dfsg/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:29 [inlined]
[3] #add_or_develop at ./none:0 [inlined]
[4] #add_or_develop#10 at /build/julia-wJr69F/julia-1.0.3+dfsg/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:27 [inlined]
[5] #add_or_develop at ./none:0 [inlined]
[6] #add#18 at /build/julia-wJr69F/julia-1.0.3+dfsg/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69 [inlined]
[7] add(::Pkg.Types.PackageSpec) at /build/julia-wJr69F/julia-1.0.3+dfsg/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69
[8] top-level scope at In[1]:1
What do you think this can come from ?
Looks like the builds of the libgit2 and libmbedtls libraries got out-of-sync. Sorry I can鈥檛 be of more help than that.
Most helpful comment
Another Arch user there,
@ararslan The official binaries work fine---I checked. It's a problem with the file Make.user in the Arch package. @goggle You have to download all files from https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/julia
and set line 11 of Make.user to
override USE_SYSTEM_LIBGIT2 = 1I recompiled and voil脿. Unfortunately I deleted the registry instead of renaming (found the same link as @goggle ... and I leave on the edge) so julia thinks I don't have any packages installed. Renaming the environment from
path/to/julia/conf/environments/v1.1topath/to/julia/conf/environments/v1.2sorted things out.