# Pkg system broken because of LibGit2

**URL:** <https://discourse.julialang.org/t/pkg-system-broken-because-of-libgit2/35710>\
**Category:** New to Julia\
**Tags:** question, package\
**Created:** [March 8, 2020, 6:24am UTC](https://discourse.julialang.org/t/pkg-system-broken-because-of-libgit2/35710 "2020-03-08T06:24:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![innerlee](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@innerlee](https://discourse.julialang.org/u/innerlee)\
**Post date:** [March 8, 2020, 6:24am UTC](https://discourse.julialang.org/t/pkg-system-broken-because-of-libgit2/35710/1 "2020-03-08T06:24:19Z")

</div>

either

```julia
$ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.3.1 (2019-12-30)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> import LibGit2

julia> LibGit2.set_ssl_cert_locations("/etc/ssl/certs/ca-certificates.crt")

signal (11): Segmentation fault
in expression starting at REPL[2]:1
unknown function (ip: 0xffffffffffffffff)
Allocations: 942697 (Pool: 942478; Big: 219); GC: 1
[1] 6208 segmentation fault (core dumped) julia

```

or

```julia
$ julia 
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.3.1 (2019-12-30)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(v1.3) pkg> up
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
┌ Warning: Some registries failed to update:
│ — /home/lizz/.julia/registries/General — failed to fetch from repo
└ @ Pkg.Types /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:1199
  Updating git-repo `https://github.com/JuliaPackaging/BinaryBuilder.jl.git`
ERROR: failed to fetch from https://github.com/JuliaPackaging/BinaryBuilder.jl.git, error: GitError(Code:ECERTIFICATE, Class:SSL, the SSL certificate is invalid: 0x08 - The certificate is not correctly signed by the trusted CA)

(v1.3) pkg> 

```

Does anyone have idea how to fix it?  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [March 8, 2020, 6:33am UTC](https://discourse.julialang.org/t/pkg-system-broken-because-of-libgit2/35710/2 "2020-03-08T06:33:32Z")

</div>

What operating system?

Also, are you using the official binaries downloaded from [JuliaLang.org](http://JuliaLang.org)?

---

<div class="post-metadata">

**Author:** ![innerlee](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@innerlee](https://discourse.julialang.org/u/innerlee)\
**Post date:** [March 8, 2020, 6:40am UTC](https://discourse.julialang.org/t/pkg-system-broken-because-of-libgit2/35710/3 "2020-03-08T06:40:08Z")

</div>

Its `Ubuntu 18.04` & official binaries

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [March 8, 2020, 6:41am UTC](https://discourse.julialang.org/t/pkg-system-broken-because-of-libgit2/35710/4 "2020-03-08T06:41:48Z")

</div>

Seems related to [LibGit2.set\_ssl\_cert\_locations segfaults on a cluster · Issue #17789 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/17789)

You may want to comment on that issue.

---

<div class="post-metadata">

**Author:** ![innerlee](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@innerlee](https://discourse.julialang.org/u/innerlee)\
**Post date:** [March 8, 2020, 6:46am UTC](https://discourse.julialang.org/t/pkg-system-broken-because-of-libgit2/35710/5 "2020-03-08T06:46:12Z")

</div>

Haha an old issue.

The workaround is

```julia
$ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.3.1 (2019-12-30)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(v1.3) pkg> up
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
┌ Warning: Some registries failed to update:
│ — /home/lizz/.julia/registries/General — failed to fetch from repo
└ @ Pkg.Types /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:1199
  Updating git-repo `https://github.com/JuliaPackaging/BinaryBuilder.jl.git`
ERROR: failed to fetch from https://github.com/JuliaPackaging/BinaryBuilder.jl.git, error: GitError(Code:ECERTIFICATE, Class:SSL, the SSL certificate is invalid: 0x08 - The certificate is not correctly signed by the trusted CA)

julia> import LibGit2

julia> LibGit2.set_ssl_cert_locations("/etc/ssl/certs/ca-certificates.crt")
0

julia> 

```

The workaround has to raise an error first, so there is no good way to put them in the startup script.
