# Failed to install Plots.jl LoadError on Arch Linux

**URL:** <https://discourse.julialang.org/t/failed-to-install-plots-jl-loaderror-on-arch-linux/65019>\
**Category:** General Usage\
**Tags:** installation\
**Created:** [July 21, 2021, 5:41am UTC](https://discourse.julialang.org/t/failed-to-install-plots-jl-loaderror-on-arch-linux/65019 "2021-07-21T05:41:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![oponkork](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oponkork/32/27362_2.png) [@oponkork](https://discourse.julialang.org/u/oponkork)\
**Post date:** [July 21, 2021, 5:41am UTC](https://discourse.julialang.org/t/failed-to-install-plots-jl-loaderror-on-arch-linux/65019/1 "2021-07-21T05:41:56Z")

</div>

I am unable to install Plots.jl on Arch Linux with `julia version 1.6.2`.

Output of `]status`

```nohighlight
      Status `~/.julia/environments/v1.6/Project.toml`
  [0c46a032] DifferentialEquations v6.17.2
  [634d3b9d] DrWatson v2.1.0
  [28b8d3ca] GR v0.58.0
  [7073ff75] IJulia v1.23.2
  [eff96d63] Measurements v2.6.0
  [d330b81b] PyPlot v2.9.0
  [b22a6f82] FFMPEG_jll v4.3.1+4

```

After `]add Plots` and `precompile`, I get the following error

```nohighlight
Precompiling project...
  ✗ FFMPEG
  ✗ GR_jll
  ✗ Plots
  0 dependencies successfully precompiled in 4 seconds (227 already precompiled)

ERROR: The following 1 direct dependency failed to precompile:

Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to /home/oponkork/.julia/compiled/v1.6/Plots/jl_I2k2pA.
ERROR: LoadError: InitError: could not load library "/home/oponkork/.julia/artifacts/7f40eeb66d90d3026ae5fb68761c263b57adb840/lib/libavdevice.so"
/usr/lib/libavformat.so.58: undefined symbol: avpriv_packet_list_free, version LIBAVCODEC_58
Stacktrace:
 [1] dlopen(s::String, flags::UInt32)
   @ Base.Libc.Libdl ./libdl.jl:114
 [2] macro expansion
   @ ~/.julia/packages/JLLWrappers/bkwIo/src/products/library_generators.jl:54 [inlined]
 [3] __init__ ()
   @ FFMPEG_jll ~/.julia/packages/FFMPEG_jll/xCSqL/src/wrappers/x86_64-linux-gnu.jl:47
 [4] top-level scope (repeats 2 times)
   @ none:1
during initialization of module FFMPEG_jll
in expression starting at /home/oponkork/.julia/packages/FFMPEG/OUpap/src/FFMPEG.jl:1
ERROR: LoadError: Failed to precompile FFMPEG [c87230d0-a227-11e9-1b43-d7ebe4e7570a] to /home/oponkork/.julia/compiled/v1.6/FFMPEG/jl_GgCh6S.
Stacktrace:
 [1] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOContext{Base.PipeEndpoint}, internal_stdout::IOContext{IOStream}, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1385
 [2] top-level scope (repeats 2 times)
   @ none:1
in expression starting at /home/oponkork/.julia/packages/Plots/S2aH5/src/Plots.jl:1

```

---

<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:** [July 21, 2021, 6:02am UTC](https://discourse.julialang.org/t/failed-to-install-plots-jl-loaderror-on-arch-linux/65019/2 "2021-07-21T06:02:39Z")

</div>

> [@oponkork](#):
>
> `/usr/lib/libavformat.so.58`

`/home/oponkork/.julia/artifacts/7f40eeb66d90d3026ae5fb68761c263b57adb840/lib/libavdevice.so` should be looking for `/home/oponkork/.julia/artifacts/7f40eeb66d90d3026ae5fb68761c263b57adb840/lib/libavformat.so`

Something is causing libavdevice.so to load your system library rather than the one in [FFMPEG\_jll](https://github.com/JuliaBinaryWrappers/FFMPEG_jll.jl). Do you have a `LD_LIBRARY_PATH` or `LD_PRELOAD` in your environmental variables?

---

<div class="post-metadata">

**Author:** ![oponkork](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oponkork/32/27362_2.png) [@oponkork](https://discourse.julialang.org/u/oponkork)\
**Post date:** [July 21, 2021, 9:03am UTC](https://discourse.julialang.org/t/failed-to-install-plots-jl-loaderror-on-arch-linux/65019/3 "2021-07-21T09:03:13Z")

</div>

I do set `LD_LIBRARY_PATH=/usr/lib:/usr/lib64:`. How do I fix the issue?

---

<div class="post-metadata">

**Author:** ![oponkork](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oponkork/32/27362_2.png) [@oponkork](https://discourse.julialang.org/u/oponkork)\
**Post date:** [July 21, 2021, 9:14am UTC](https://discourse.julialang.org/t/failed-to-install-plots-jl-loaderror-on-arch-linux/65019/4 "2021-07-21T09:14:38Z")

</div>

Okay, I tried `ENV["LD_LIBRARY_PATH"] = ""` in the julia repl and then precompiled and it worked. Is this the correct approach?

---

<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:** [July 22, 2021, 7:30am UTC](https://discourse.julialang.org/t/failed-to-install-plots-jl-loaderror-on-arch-linux/65019/5 "2021-07-22T07:30:59Z")

</div>

That works, but I recommend investigating why LD\_LIBRARY\_PATH is set in the first place. Is it in your .bash\_profile or .bashrc or something like that?

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [July 22, 2021, 7:42am UTC](https://discourse.julialang.org/t/failed-to-install-plots-jl-loaderror-on-arch-linux/65019/6 "2021-07-22T07:42:56Z")

</div>

did you install julia via `pacman`? please use `julia-bin` from AUR or directly download binary yourself from [julialang.org](http://julialang.org)

---

<div class="post-metadata">

**Author:** ![oponkork](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oponkork/32/27362_2.png) [@oponkork](https://discourse.julialang.org/u/oponkork)\
**Post date:** [July 22, 2021, 8:38am UTC](https://discourse.julialang.org/t/failed-to-install-plots-jl-loaderror-on-arch-linux/65019/7 "2021-07-22T08:38:18Z")

</div>

I set it myself, do not remember why but needed it at some point in the past. Maybe I will remove it and see if anything else breaks.

---

<div class="post-metadata">

**Author:** ![oponkork](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oponkork/32/27362_2.png) [@oponkork](https://discourse.julialang.org/u/oponkork)\
**Post date:** [July 22, 2021, 8:39am UTC](https://discourse.julialang.org/t/failed-to-install-plots-jl-loaderror-on-arch-linux/65019/8 "2021-07-22T08:39:17Z")

</div>

Yes. I installed it via pacman. Is there a reason to pick up AUR package over the pacman one?

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [July 22, 2021, 8:40am UTC](https://discourse.julialang.org/t/failed-to-install-plots-jl-loaderror-on-arch-linux/65019/9 "2021-07-22T08:40:46Z")

</div>

the reason is linux distro maintainers don’t care about Julia they only care if Julia compiles with their libraries. Better use ready-made binary Julia, either manually, or use AUR which is the same thing except it will update later.
