# Precompile errors with \`pkg\> update\` or \`pkg\> add\` for some packages

**URL:** <https://discourse.julialang.org/t/precompile-errors-with-pkg-update-or-pkg-add-for-some-packages/83917>\
**Category:** General Usage\
**Tags:** pkg, error\
**Created:** [July 7, 2022, 7:31pm UTC](https://discourse.julialang.org/t/precompile-errors-with-pkg-update-or-pkg-add-for-some-packages/83917 "2022-07-07T19:31:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![forestacorn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/forestacorn/32/19260_2.png) [@forestacorn](https://discourse.julialang.org/u/forestacorn)\
**Post date:** [July 7, 2022, 7:31pm UTC](https://discourse.julialang.org/t/precompile-errors-with-pkg-update-or-pkg-add-for-some-packages/83917/1 "2022-07-07T19:31:13Z")

</div>

In the package manager I was getting some precompilation errors when trying to `update` Julia. So I have removed all the offending packages, which included Pluto and tried to `add Pluto` again with the following result:

```julia
(@v1.7) pkg> precompile

(@v1.7) pkg> add Pluto
   Resolving package versions...
    Updating `~/.julia/environments/v1.7/Project.toml`
  [c3e4b0f8] + Pluto v0.19.9
    Updating `~/.julia/environments/v1.7/Manifest.toml`
  [5218b696] + Configurations v0.17.3
  [55351af7] + ExproniconLite v0.6.13
  [fb4132e2] + FuzzyCompletions v0.5.0
  [ac1192a8] + HypertextLiteral v0.9.4
  [6c6e2e6c] + MIMEs v0.1.4
  [99f44e22] + MsgPack v1.1.0
  [c3e4b0f8] + Pluto v0.19.9
  [91cefc8d] + PrecompileSignatures v3.0.3
  [410a4b4d] + Tricks v0.1.6
Precompiling project...
  ✗ Pluto
  0 dependencies successfully precompiled in 10 seconds (210 already precompiled)
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

(@v1.7) pkg> precompile
Precompiling project...
  ✗ Pluto
  0 dependencies successfully precompiled in 11 seconds (210 already precompiled)

ERROR: The following 1 direct dependency failed to precompile:

Pluto [c3e4b0f8-55cb-11ea-2926-15256bba5781]

Failed to precompile Pluto [c3e4b0f8-55cb-11ea-2926-15256bba5781] to /home/kw/.julia/compiled/v1.7/Pluto/jl_dNQlkc.
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] include(x::String)
   @ Pluto ~/.julia/packages/Pluto/9zGI7/src/Pluto.jl:11
 [6] top-level scope
   @ ~/.julia/packages/Pluto/9zGI7/src/Pluto.jl:62
 [7] top-level scope (repeats 2 times)
   @ none:1
during initialization of module MbedTLS
in expression starting at /home/kw/.julia/packages/Pluto/9zGI7/src/notebook/Events.jl:1
in expression starting at /home/kw/.julia/packages/Pluto/9zGI7/src/Pluto.jl:1

```

Can anyone offer me some guidance on how to fix this problem.

It has only recently become a problem, I have not had any errors when adding packages in the past and neither have I made any changes anywhere. However I have recently installed and been learning to use Julia in VSCode, could that be related to this problem?

My system is Manjaro 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 7, 2022, 8:11pm UTC](https://discourse.julialang.org/t/precompile-errors-with-pkg-update-or-pkg-add-for-some-packages/83917/2 "2022-07-07T20:11:04Z")

</div>

@quinnj this looks related to [Switch default cert to MozillaCACerts\_jll by quinnj · Pull Request #238 · JuliaLang/MbedTLS.jl · GitHub](https://github.com/JuliaLang/MbedTLS.jl/pull/238).

---

<div class="post-metadata">

**Author:** ![apolionl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apolionl/32/37776_2.png) [@apolionl](https://discourse.julialang.org/u/apolionl)\
**Post date:** [July 8, 2022, 10:48am UTC](https://discourse.julialang.org/t/precompile-errors-with-pkg-update-or-pkg-add-for-some-packages/83917/3 "2022-07-08T10:48:20Z")

</div>

I solved this problem in the following way.

1. Download the [nightlies](https://julialang.org/downloads/nightlies/) Julia
2. Unpack
3. Go to julia-####/share/julia
4. Copy cert.pem to the place where is is required, in our case /usr/share/julia
5. Enjoy 😄

Hope it solves your problem.

I forgot something to mention, that might be important in the future. When you decide to reintall julia, or maybe in the next update, it could be possible that the update will give you an error. Something like “/usr/share/julia/cert.pem arleady exist” , then , you need to delete it, and , it would work find.

---

<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:56pm UTC](https://discourse.julialang.org/t/precompile-errors-with-pkg-update-or-pkg-add-for-some-packages/83917/4 "2022-07-09T18:56:20Z")

</div>

See

> [@Problems installing packages - cert.pm no such file](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995/4):
>
> 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 …

Summary: in Arch Linux use the package [`aur:julia-bin`](https://aur.archlinux.org/packages/julia-bin) which simply redistributes the [official binaries](https://julialang.org/downloads/), don’t use the [package](https://archlinux.org/packages/community/x86_64/julia/) in the official repositories, which has lots of problems. This is also documented in [Arch Linux wiki](https://wiki.archlinux.org/title/Julia#Installation).

---

<div class="post-metadata">

**Author:** ![forestacorn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/forestacorn/32/19260_2.png) [@forestacorn](https://discourse.julialang.org/u/forestacorn)\
**Post date:** [July 10, 2022, 1:43pm UTC](https://discourse.julialang.org/t/precompile-errors-with-pkg-update-or-pkg-add-for-some-packages/83917/5 "2022-07-10T13:43:53Z")

</div>

That does indeed appear to be the essential information I needed to fix this problem, I have now replaced Julia from the Manjaro repositories with the [aur: julia-bin](https://aur.archlinux.org/packages/julia-bin) version.
