# Problems installing packages - cert.pm no such file

**URL:** <https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995>\
**Category:** General Usage\
**Created:** [July 9, 2022, 5:47pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995 "2022-07-09T17:47:54Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdarnold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jdarnold/32/31365_2.png) [@jdarnold](https://discourse.julialang.org/u/jdarnold)\
**Post date:** [July 9, 2022, 5:47pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/1 "2022-07-09T17:47:54Z")

</div>

I am trying to use the Genie web framework and I get the following error when I try to use it on my Arch Linux:

```julia
julia> using Genie
[Info: Precompiling Genie [c43c736e-a2d1-11e8-161f-af95117fbd1e]
ERROR: LoadError: InitError: SystemError: opening file "/usr/share/julia/cert.pem": No such file or directory
Stacktrace:
 [1] open
   @ ./io.jl:328 [inlined]
 [2] read(filename::String, #unused#::Type{String})
   @ Base ./io.jl:436
 [3] __sslinit__ ()
   @ MbedTLS ~/.julia/packages/MbedTLS/qUI5E/src/ssl.jl:785
 [4] __init__ ()
   @ MbedTLS ~/.julia/packages/MbedTLS/qUI5E/src/MbedTLS.jl:55
 [5] top-level scope (repeats 2 times)
   @ none:1
during initialization of module MbedTLS
in expression starting at /home/jdarnold/.julia/packages/VersionCheck/IzZOn/src/VersionCheck.jl:1
ERROR: LoadError: Failed to precompile VersionCheck [a637dc6b-bca1-447e-a4fa-35264c9d0580] to /home/jdarnold/.julia/compiled/v1.7/VersionCheck/jl_TrpQIr.
Stacktrace:
 [1] include(x::String)
   @ Genie ~/.julia/packages/Genie/hbOGK/src/Genie.jl:4
 [2] top-level scope
   @ ~/.julia/packages/Genie/hbOGK/src/Genie.jl:12
 [3] top-level scope (repeats 2 times)
   @ none:1
in expression starting at /home/jdarnold/.julia/packages/Genie/hbOGK/src/Configuration.jl:1
in expression starting at /home/jdarnold/.julia/packages/Genie/hbOGK/src/Genie.jl:1
ERROR: Failed to precompile Genie [c43c736e-a2d1-11e8-161f-af95117fbd1e] to /home/jdarnold/.julia/compiled/v1.7/Genie/jl_QRz4ze.

```

Just to check I tried installing another package and got the same error. I’ve looked around but I don’t see the answer to fixing this.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [July 9, 2022, 6:30pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/2 "2022-07-09T18:30:52Z")

</div>

> [@jdarnold](#):
>
> when I try to use it on my Arch Linux

How did you install Julia on Arch Linux?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [July 9, 2022, 6:48pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/3 "2022-07-09T18:48:41Z")

</div>

Probably the same issue as [Precompile errors with `pkg\> update` or `pkg\> add` for some packages](https://discourse.julialang.org/t/precompile-errors-with-pkg-update-or-pkg-add-for-some-packages/83917)

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [July 9, 2022, 6:53pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/4 "2022-07-09T18:53:45Z")

</div>

Ok, my educated guess is that you installed the [package](https://archlinux.org/packages/community/x86_64/julia/) from the official repositories, which is well known to have plenty of problems: [Julia - ArchWiki](https://wiki.archlinux.org/title/Julia#Installation). Evidence: the error message is pointing to  
[MbedTLS.jl/ssl.jl at 0c02e44ed96bf09ce3b9fb649db5914f629c2812 · JuliaLang/MbedTLS.jl · GitHub](https://github.com/JuliaLang/MbedTLS.jl/blob/0c02e44ed96bf09ce3b9fb649db5914f629c2812/src/ssl.jl#L785)  
and the variable `MozillaCACerts_jll.cacert` is apparently pointing to a non-existing file. You should direct your complaint to the maintainers of the Julia package in Arch Linux, who provide malfunctioning packages.

In the meantime I warmly recommend you to use the package [`aur:julia-bin`](https://aur.archlinux.org/packages/julia-bin) which simply redistributes the [official binaries](https://julialang.org/downloads/).

---

<div class="post-metadata">

**Author:** ![jdarnold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jdarnold/32/31365_2.png) [@jdarnold](https://discourse.julialang.org/u/jdarnold)\
**Post date:** [July 9, 2022, 8:17pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/5 "2022-07-09T20:17:40Z")

</div>

Thanks, that sounds like it. Pretty sure it is the “official” package. I will use the AUR bin one.

Edited to add: Yup. Just installed julia-bin and using Genie works fine. Thanks again.

---

<div class="post-metadata">

**Author:** ![dimpase](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dimpase/32/22644_2.png) [@dimpase](https://discourse.julialang.org/u/dimpase)\
**Post date:** [December 28, 2022, 10:16am UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/6 "2022-12-28T10:16:34Z")

</div>

Is Julia trying to do its own crypto, by any chance? (a scary thought).

I have the same error (while trying to use `HTTP` package) with Julia 1.8.3 on Gentoo Linux, compiled from source.

If several different Linux packagers get this wrong, something might be fishy…

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [December 28, 2022, 1:35pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/7 "2022-12-28T13:35:22Z")

</div>

> [@dimpase](#):
>
> Is Julia trying to do its own crypto, by any chance? (a scary thought).

No?

> [@dimpase](#):
>
> If several different Linux packagers get this wrong, something might be fishy…

Agreed, I guess none of them runs the tests, which [would fail if the file is missing](https://github.com/JuliaLang/julia/blob/dd8d58e6048464d83597114eb65539ec8c8d71ab/stdlib/MozillaCACerts_jll/test/runtests.jl#L7).

---

<div class="post-metadata">

**Author:** ![dimpase](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dimpase/32/22644_2.png) [@dimpase](https://discourse.julialang.org/u/dimpase)\
**Post date:** [December 28, 2022, 3:33pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/8 "2022-12-28T15:33:08Z")

</div>

I see this error on Gentoo via a different package, MbedTLS (or HTTP).

As a matter of fact, Fedora packages MbedTLS as a dependence of Julia, and all works there.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [December 28, 2022, 3:35pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/9 "2022-12-28T15:35:10Z")

</div>

> [@dimpase](#):
>
> As a matter of fact, Fedora packages MbedTLS as a dependence of Julia, and all works there.

Sure, because Fedora maintainer is @nalimilan who knows what to do.

---

<div class="post-metadata">

**Author:** ![dimpase](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dimpase/32/22644_2.png) [@dimpase](https://discourse.julialang.org/u/dimpase)\
**Post date:** [December 29, 2022, 11:51pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/10 "2022-12-29T23:51:55Z")

</div>

But why does Julia even want to deal with CA certificates directly? Isn’t all what’s needed already in `libcurl` (to which it talks via `LibCURL_jll`, as far as I understand)?

Anyhow, if needed, `curl` provides functionality to deal with CA certs, e.g. [curl - Extract CA Certs from Mozilla](https://curl.se/docs/caextract.html), [curl - SSL CA Certificates](https://curl.se/docs/sslcerts.html)

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [December 30, 2022, 12:23am UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/11 "2022-12-30T00:23:52Z")

</div>

Julia is using MbedTLS and the version of LibCURL distributed with official Julia is linked against MbedTLS:

> <https://github.com/JuliaPackaging/Yggdrasil/blob/3573c32ce13a40902477be7993fa0bf8fe377f35/L/LibCURL/common.jl#L65>

Above, the OP is using Genie.jl which loads MbedTLS.jl which wraps the native library in MbedTLS\_jll. Usually that is as follows:

```julia
julia> using MbedTLS_jll

julia> MbedTLS_jll.libmbedtls_path
"/home/mkitti/src/julia-1.8.1/bin/../lib/julia/libmbedtls.so.14"

```

Whoever setup the package on Gentoo likely swapped out Julia’s vendored libmedtls for a Gentoo package. However, they likely did not tell Julia where to find the certificates. That can be set via an environment variable:

> <https://github.com/JuliaLang/MbedTLS.jl/blob/da061d0dbe51f84677e6c1aec9f115326d32201a/src/ssl.jl#L778-L796>

If you insist on using the Gentoo package, then you should file a bug report with the Gentoo packagers:

> **[dev-lang/julia – Gentoo Packages](https://packages.gentoo.org/packages/dev-lang/julia)**
>
> Gentoo Packages Database

---

<div class="post-metadata">

**Author:** ![dimpase](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dimpase/32/22644_2.png) [@dimpase](https://discourse.julialang.org/u/dimpase)\
**Post date:** [December 30, 2022, 11:29am UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/12 "2022-12-30T11:29:50Z")

</div>

Still, having an explicit `/usr/share/julia/cert.pem` is a security issue. In case it is not a symbolic link to someplace managed by the OS, but a file, it will be vulnerable to problems with CA certificates such as the recent [TrustCor story](https://www.theregister.com/2022/12/02/mozilla_microsoft_trustcor/).

On my Fedora 34 system at work, `/usr/share/julia/cert.pem` is a symbolic link to a 210K-big bundle of CA certs. As far as I know, Gentoo does not even have such a bundle available - and there is no need for it, technically speaking, as it’s more efficient to keep each certificate in a separate file (it does have a bundle of CA certs in another format, in  
/etc/ssl/certs/ca-certificates.crt)

---

<div class="post-metadata">

**Author:** ![dimpase](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dimpase/32/22644_2.png) [@dimpase](https://discourse.julialang.org/u/dimpase)\
**Post date:** [December 30, 2022, 11:52am UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/13 "2022-12-30T11:52:31Z")

</div>

> [@mkitti](#):
>
> Whoever setup the package on Gentoo likely swapped out Julia’s vendored libmedtls for a Gentoo package.

this is correct. However, it is the case also on Fedora 34 (with working Julia).

---

<div class="post-metadata">

**Author:** ![dimpase](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dimpase/32/22644_2.png) [@dimpase](https://discourse.julialang.org/u/dimpase)\
**Post date:** [December 30, 2022, 12:25pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/14 "2022-12-30T12:25:25Z")

</div>

Filed [888978 – dev-lang/julia needs /usr/share/julia/cert.pem](https://bugs.gentoo.org/888978) to address this in Gentoo

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [December 30, 2022, 12:55pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/15 "2022-12-30T12:55:31Z")

</div>

Based on the above, I suppose a distribution could patch the following such that `MozillaCACerts_jll.cacert` points to the correct file.

> <https://github.com/JuliaLang/julia/blob/a8adb3938bb82bd686066aff38dcecbd31288547/stdlib/MozillaCACerts_jll/src/MozillaCACerts_jll.jl#L20>

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [December 30, 2022, 2:48pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/16 "2022-12-30T14:48:43Z")

</div>

Yes, that’s how that’s supposed to work. Julia (or rather some internal tools used by Julia, like curl) needs a reference to the certificates file, it can come from anywhere, in Gentoo it comes from nowhere, they could have run the tests to catch the missing file 🤷
