Error: failed to clone ...

I discovered Julia very recently and am very excited about what I have seen in some youtube presentations. I want to start using Julia instead of C++ and python. However my first experience (on xubuntu) is very discouraging - see below. Any help to get me past this issue is highly appreciated.

thh@thh-Aspire-XC600:~$ julia-stable
_
_ _ ()_ | Documentation: https://docs.julialang.org
() | () () |
_ _ | | __ _ | Type “?” for help, “]?” for Pkg help.
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 1.0.0 (2018-08-08)
/ |_|||_’_| | Official https://julialang.org/ release
|__/ |

julia> using Pkg

julia> Pkg.add(“Plots”)
Cloning default registries into /home/thh/snap/julia-stable/1/.julia/registries
Cloning registry General from “GitHub - JuliaRegistries/General: The official registry of general Julia packages
ERROR: failed to clone from GitHub - JuliaRegistries/General: The official registry of general Julia packages, error: GitError(Code:ERROR, Class:Net, curl error: Could not resolve host: github.com
)
Stacktrace:
[1] pkgerror(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:120
[2] #clone#2(::String, ::Base.Iterators.Pairs{Symbol,LibGit2.CachedCredentials,Tuple{Symbol},NamedTuple{(:credentials,),Tuple{LibGit2.CachedCredentials}}}, ::Function, ::String, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GitTools.jl:102
[3] #clone at ./none:0 [inlined]
[4] (::getfield(Pkg.Types, Symbol(“##50#54”)))(::LibGit2.CachedCredentials) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:927
[5] shred!(::getfield(Pkg.Types, Symbol(“##50#54”)), ::LibGit2.CachedCredentials) at ./secretbuffer.jl:184
[6] #registries#49(::Bool, ::Function) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:923
[7] registries at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:907 [inlined]
[8] macro expansion at ./logging.jl:307 [inlined]
[9] update_registry(::Pkg.Types.Context) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:96
[10] #handle_repos_add!#31(::Bool, ::Nothing, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:593
[11] #handle_repos_add! at ./none:0 [inlined]
[12] #add_or_develop#13(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:54
[13] #add_or_develop at ./none:0 [inlined]
[14] #add_or_develop#12 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:29 [inlined]
[15] #add_or_develop at ./none:0 [inlined]
[16] #add_or_develop#11(::Base.Iterators.Pairs{Symbol,Symbol,Tuple{Symbol},NamedTuple{(:mode,),Tuple{Symbol}}}, ::Function, ::Array{String,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:28
[17] #add_or_develop at ./none:0 [inlined]
[18] #add_or_develop#10 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:27 [inlined]
[19] #add_or_develop at ./none:0 [inlined]
[20] #add#18 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69 [inlined]
[21] add(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69
[22] top-level scope at none:0

How did you install Julia? Will running the git clone directly (e.g. $ git clone https://github.com/JuliaRegistries/General.git) succeed?

This seems to be an error with your network, rather than with Julia per se (but I may be wrong). Are you behind a proxy or firewall?

Thanks for fast replies. (I am not behind a proxy or firewall)

I installed Julia with the software manager of (x)ubuntu - apparently this was the problem. In the meanwhile I removed it and compiled it from the sources instead and now it works :slight_smile:

Tim

You can also just download the generic Linux binary, rather than compiling it yourself.

1 Like

I just want to point out that the julia installations provided by various platform specific package managers are not generally officially supported - they are community contributed and may differ from the official version from Download Julia. See here, section Distribution-Specific Packages.