# Installation of Plots package fails on Ubuntu 18.04

**URL:** https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932
**Category:** General Usage
**Created:** [February 15, 2025, 3:31am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932 "2025-02-15T03:31:07Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![fanzhy171](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fanzhy171/32/213949_2.png) [@fanzhy171](https://discourse.julialang.org/u/fanzhy171)
#### Post date: [February 15, 2025, 3:31am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/1 "2025-02-15T03:31:07Z")

</div>

Hello everyone. I met a problem when install Plots.jl package. The problem is I always failed to precompile a few things. I tried to look it up, but the solution of the past post is not clear enough for me, so I just start this new one. Anyways, here is the error:

```julia
(@v1.11) pkg> add Plots
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
  No Changes to `~/.julia/environments/v1.11/Project.toml`
  No Changes to `~/.julia/environments/v1.11/Manifest.toml`
Precompiling project...
  ✗ Cairo_jll
  ✗ Qt6Base_jll
  ✗ HarfBuzz_jll
  ✗ Qt6ShaderTools_jll
  ✗ libass_jll
  ✗ Pango_jll
  ✗ Qt6Declarative_jll
  ✗ libdecor_jll
  ✗ Qt6Wayland_jll
  ✗ FFMPEG_jll
  ✗ GLFW_jll
  ✗ FFMPEG
  ✗ GR_jll
  ✗ GR
  ✗ Plots
  ✗ Plots → UnitfulExt
  0 dependencies successfully precompiled in 78 seconds. 171 already precompiled.
  16 dependencies errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

```

Based on the replies in other posts, I also check the status of my package and `versioninfo()` :

```julia
status --outdated -m
Status `~/.julia/environments/v1.11/Manifest.toml`
⌅ [b22a6f82] FFMPEG_jll v4.4.4+1 (<v7.1.0+0): FFMPEG
⌅ [e9f186c6] Libffi_jll v3.2.2+2 (<v3.4.6+4): Glib_jll, HarfBuzz_jll, Wayland_jll
⌅ [30392449] Pixman_jll v0.43.4+0 (<v0.44.2+0): Cairo_jll
⌅ [c0090381] Qt6Base_jll v6.7.1+1 (<v6.8.2+1): GR_jll, Qt6Declarative_jll, Qt6ShaderTools_jll, Qt6Wayland_jll
⌅ [629bc702] Qt6Declarative_jll v6.7.1+2 (<v6.8.2+1): Qt6Wayland_jll
⌅ [ce943373] Qt6ShaderTools_jll v6.7.1+1 (<v6.8.2+1): Qt6Declarative_jll
⌃ [e99dba38] Qt6Wayland_jll v6.7.1+1 (<v6.8.2+0)
⌅ [1270edf5] x264_jll v2021.5.5+0 (<v10164.0.1+0): FFMPEG_jll
⌅ [dfaa095f] x265_jll v3.5.0+0 (<v4.1.0+0): FFMPEG_jll 

```

```julia
Julia Version 1.11.3
Commit d63adeda50d (2025-01-21 19:42 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 12 × Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, haswell)

```

I do notice there are some overlaps between the failed compilation and outdated packages, but I don’t know if the issue is this one.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [February 15, 2025, 6:51am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/2 "2025-02-15T06:51:58Z")

</div>

And what’s the error?

But yeah I’d say first fix those old versions. From your pkg prompt I guess you are dumping all your packages into the default environment, leading to version conflicts. Don’t do that, work in project specific environments instead.

For a quick check on whether that’s the issue do `] activate --temp` and add Plots there

---

<div class="post-metadata">

### Author: ![fanzhy171](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fanzhy171/32/213949_2.png) [@fanzhy171](https://discourse.julialang.org/u/fanzhy171)
#### Post date: [February 15, 2025, 7:02am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/3 "2025-02-15T07:02:55Z")

</div>

The error is like this:

```julia

Plots 

Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to "/home/zhiyufan/.julia/compiled/v1.11/Plots/jl_2JtyZT".
ERROR: LoadError: InitError: could not load library "/home/zhiyufan/.julia/artifacts/6d8a1f48d4b47dc03fa048d88680be84ae15e5fc/lib/libgobject-2.0.so"
/home/zhiyufan/.julia/artifacts/6d8a1f48d4b47dc03fa048d88680be84ae15e5fc/lib/libgobject-2.0.so: undefined symbol: g_dir_unref
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl ./libdl.jl:120
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl ./libdl.jl:119
  [3] macro expansion
    @ ~/.julia/packages/JLLWrappers/GfYNv/src/products/library_generators.jl:63 [inlined]
  [4] __init__ ()
    @ Glib_jll ~/.julia/packages/Glib_jll/hPWTx/src/wrappers/x86_64-linux-gnu.jl:43
  [5] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1378
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1366
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}, ignore_native::Nothing; register::Bool)
    @ Base ./loading.jl:1254
  [8] _include_from_serialized (repeats 2 times)
    @ ./loading.jl:1210 [inlined]
  [9] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{String, Int64}, DEPOT_PATH::Vector{String})
    @ Base ./loading.jl:2057
 [10] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2527
 [11] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2388
 [12] #invoke_in_world#3
    @ ./essentials.jl:1089 [inlined]
 [13] invoke_in_world
    @ ./essentials.jl:1086 [inlined]
 [14] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2375
 [15] macro expansion
    @ ./loading.jl:2314 [inlined]
 [16] macro expansion
    @ ./lock.jl:273 [inlined]
 [17] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2271
 [18] #invoke_in_world#3
    @ ./essentials.jl:1089 [inlined]
 [19] invoke_in_world
    @ ./essentials.jl:1086 [inlined]
 [20] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2260
 [21] include(mod::Module, _path::String)
    @ Base ./Base.jl:557
 [22] top-level scope
    @ ~/.julia/packages/JLLWrappers/GfYNv/src/toplevel_generators.jl:199
 [23] include
    @ ./Base.jl:557 [inlined]
 [24] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base ./loading.jl:2881
 [25] top-level scope
    @ stdin:6
during initialization of module Glib_jll
in expression starting at /home/zhiyufan/.julia/packages/Cairo_jll/UW7QZ/src/wrappers/x86_64-linux-gnu.jl:4
in expression starting at /home/zhiyufan/.julia/packages/Cairo_jll/UW7QZ/src/Cairo_jll.jl:2
in expression starting at stdin:6

```

I tried this `] activate --temp`, but error remains.  
Also I don’t update those packages, because I see this:

> Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [February 15, 2025, 7:09am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/4 "2025-02-15T07:09:13Z")

</div>

But I assume the packages are up to date in your temp environment?

---

<div class="post-metadata">

### Author: ![fanzhy171](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fanzhy171/32/213949_2.png) [@fanzhy171](https://discourse.julialang.org/u/fanzhy171)
#### Post date: [February 15, 2025, 7:26am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/5 "2025-02-15T07:26:50Z")

</div>

When I try to update, I got the same message

```julia
(jl_lUbmg5) pkg> update
    Updating registry at `~/.julia/registries/General.toml`
  No Changes to `/tmp/jl_lUbmg5/Project.toml`
  No Changes to `/tmp/jl_lUbmg5/Manifest.toml`
Precompiling project...
  ✗ Cairo_jll
  ✗ Qt6Base_jll
  ✗ HarfBuzz_jll
  ✗ Qt6ShaderTools_jll
  ✗ libass_jll
  ✗ Pango_jll
  ✗ Qt6Declarative_jll
  ✗ libdecor_jll
  ✗ Qt6Wayland_jll
  ✗ FFMPEG_jll
  ✗ GLFW_jll
  ✗ FFMPEG
  ✗ GR_jll
  ✗ GR
  ✗ Plots
  ✗ Plots → UnitfulExt
  0 dependencies successfully precompiled in 73 seconds. 171 already precompiled.
  16 dependencies errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

```

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [February 15, 2025, 7:50am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/6 "2025-02-15T07:50:56Z")

</div>

As a first step, make a backup of your global Project.toml and Manifest.toml file, which can be found here:

```julia
ls ~/.julia/environments/v1.11
Manifest.toml Project.toml

```

Then delete them.

Then install Plots.jl in a new, empty environment:

```julia
mkdir myproject
cd myproject
julia --startup-file=no --project=.

```

and then in Julia:

```julia
using Pkg
pkg"add Plots"

```

Does that work?

If that should work, you could then add - one by one - the other packages you need for your project.

---

<div class="post-metadata">

### Author: ![fanzhy171](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fanzhy171/32/213949_2.png) [@fanzhy171](https://discourse.julialang.org/u/fanzhy171)
#### Post date: [February 15, 2025, 7:59am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/7 "2025-02-15T07:59:33Z")

</div>

No it doesn’t work. Same thing

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [February 15, 2025, 8:00am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/8 "2025-02-15T08:00:43Z")

</div>

How did you install Julia?

---

<div class="post-metadata">

### Author: ![fanzhy171](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fanzhy171/32/213949_2.png) [@fanzhy171](https://discourse.julialang.org/u/fanzhy171)
#### Post date: [February 15, 2025, 8:02am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/9 "2025-02-15T08:02:37Z")

</div>

Using juliaup. I even install a new version, which is older v1.10.8, just in case if the constrain can be removed, but no luck

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [February 15, 2025, 8:06am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/10 "2025-02-15T08:06:10Z")

</div>

Worst case just rename the `.julia` folder and try again.

```julia
mv .julia .julia_bak

```

If that does not help, perhaps you have a very unusual Linux distribution or CPU?

---

<div class="post-metadata">

### Author: ![fanzhy171](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fanzhy171/32/213949_2.png) [@fanzhy171](https://discourse.julialang.org/u/fanzhy171)
#### Post date: [February 15, 2025, 8:16am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/11 "2025-02-15T08:16:49Z")

</div>

The same. Probably a really older version of the Linux.

```julia
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

```

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [February 15, 2025, 8:19am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/12 "2025-02-15T08:19:47Z")

</div>

Well, an LTS version is usually supported for 5 years… I have still Julia code running on Ubuntu 18.04. I use ControlPlots.jl, though.

---

<div class="post-metadata">

### Author: ![fanzhy171](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fanzhy171/32/213949_2.png) [@fanzhy171](https://discourse.julialang.org/u/fanzhy171)
#### Post date: [February 15, 2025, 8:41am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/13 "2025-02-15T08:41:34Z")

</div>

Thanks, I just tried that. But seems both need those packages, so I don’t know what is going on.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [February 15, 2025, 12:13pm UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/14 "2025-02-15T12:13:33Z")

</div>

I just tried ControlPlots.jl on Ubuntu 18.04 using Julia 1.10.7, and it works fine.  
Worth to mention: Install `matplotlib` first, using the command:

```julia
sudo apt install python3-matplotlib

```

I also tried to use Plots.jl on Ubuntu 18.04. The installation works, but the command `using Plots` fails.

Whatever you do, do it in a clean environment:

```julia
mkdir test
cd test
julia --project=.

```

and then in Julia:

```julia
using Pkg
pkg"add ControlPlots"

```

So if you need a working Plots.jl package you need to upgrade Ubuntu, which is usually easy.

---

<div class="post-metadata">

### Author: ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)
#### Post date: [February 15, 2025, 7:51pm UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/15 "2025-02-15T19:51:12Z")

</div>

> [@fanzhy171](#):
>
> ```julia
> Plots 
> 
> Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to "/home/zhiyufan/.julia/compiled/v1.11/Plots/jl_2JtyZT".
> ERROR: LoadError: InitError: could not load library "/home/zhiyufan/.julia/artifacts/6d8a1f48d4b47dc03fa048d88680be84ae15e5fc/lib/libgobject-2.0.so"
> /home/zhiyufan/.julia/artifacts/6d8a1f48d4b47dc03fa048d88680be84ae15e5fc/lib/libgobject-2.0.so: undefined symbol: g_dir_unref
> Stacktrace:
> 
> ```

This shows that the chain of dynamic libraries is broken on your system. (`g_dir_unref` should be resolved by another library in the same artifact directory, but some older version of the library has presumably been loaded instead.)  
Do you have `LD_LIBRARY_PATH` or something similar in your environment variables?

---

<div class="post-metadata">

### Author: ![fanzhy171](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fanzhy171/32/213949_2.png) [@fanzhy171](https://discourse.julialang.org/u/fanzhy171)
#### Post date: [February 17, 2025, 2:08am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/16 "2025-02-17T02:08:41Z")

</div>

The output is this, and I don’t find anything like that.

> (base) zhiyufan@athena:~$ echo $LD\_LIBRARY\_PATH  
> /home/zhiyufan/miniconda3/lib:/home/zhiyufan/miniconda3/lib:/public/software/mpi/openmpi/2.0.2/intel/lib:/opt/app/intel/2020/compilers\_and\_libraries\_2020.4.304/linux/daal/…/tbb/lib/intel64\_lin/gcc4.8:/opt/app/intel/2020/compilers\_and\_libraries\_2020.4.304/linux/daal/…/tbb/lib/intel64\_lin/gcc4.4:/opt/app/intel/2020/compilers\_and\_libraries\_2020.4.304/linux/daal/lib/intel64\_lin:/opt/app/intel/2020/debugger\_2020/python/intel64/lib:/opt/app/intel/2020/debugger\_2020/libipt/intel64/lib:/opt/app/intel/2020/compilers\_and\_libraries\_2020.4.304/linux/tbb/lib/intel64/gcc4.8:/opt/app/intel/2020/compilers\_and\_libraries\_2020.4.304/linux/mkl/lib/intel64\_lin:/opt/app/intel/2020/compilers\_and\_libraries\_2020.4.304/linux/ipp/lib/intel64:/opt/app/intel/2020/compilers\_and\_libraries\_2020.4.304/linux/compiler/lib/intel64\_lin:/public/software/mathlib/blitz/lib:/public/software/mathlib/fftw/fftw-3.3.9/lib:/public/software/mpi/oompi/lib:/public/software/mathlib/blitz/lib:/public/software/mathlib/fftw/fftw-3.3.9/lib:/public/software/mpi/oompi/lib:/public/software/mathlib/blitz/lib:/public/software/mathlib/fftw/fftw-3.3.9/lib:/public/software/mpi/oompi/lib

---

<div class="post-metadata">

### Author: ![fanzhy171](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fanzhy171/32/213949_2.png) [@fanzhy171](https://discourse.julialang.org/u/fanzhy171)
#### Post date: [February 17, 2025, 2:20am UTC](https://discourse.julialang.org/t/installation-of-plots-package-fails-on-ubuntu-18-04/125932/17 "2025-02-17T02:20:15Z")

</div>

I checked and found out that it was already installed.
