# .julia shared

**URL:** https://discourse.julialang.org/t/julia-shared/59213
**Category:** New to Julia
**Tags:** question
**Created:** [April 13, 2021, 4:09pm UTC](https://discourse.julialang.org/t/julia-shared/59213 "2021-04-13T16:09:07Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![marllos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marllos/32/205917_2.png) [@marllos](https://discourse.julialang.org/u/marllos)
#### Post date: [April 13, 2021, 4:09pm UTC](https://discourse.julialang.org/t/julia-shared/59213/1 "2021-04-13T16:09:07Z")

</div>

Hello everyone! My question is the following: How do I modify the location of .julia so that it is available to all users on the system? Say I choose location: /usr/local/.julia, then when a user does a pkg\> add package, will that package also be available to other users? That is my intention. Thanks.

---

<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: [April 13, 2021, 4:14pm UTC](https://discourse.julialang.org/t/julia-shared/59213/2 "2021-04-13T16:14:30Z")

</div>

Modify [`JULIA_DEPOT_PATH`](https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_DEPOT_PATH). However, I would advise against putting a shared directory as the first entry in there since that is also used for other things such as the default package environment, REPL history, etc, that you probably don’t want users to share.

---

<div class="post-metadata">

### Author: ![marllos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marllos/32/205917_2.png) [@marllos](https://discourse.julialang.org/u/marllos)
#### Post date: [April 13, 2021, 4:24pm UTC](https://discourse.julialang.org/t/julia-shared/59213/3 "2021-04-13T16:24:11Z")

</div>

Got it, I think I will give up on this idea. But then I can use JULIA\_DEPOT\_PATH, to separate the versions of julia? For example:  
/opt/julia-1.5.4 and ~/.julia-1.5.4  
/opt/julia-1.6.0 and ~/.julia-1.6.0

---

<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: [April 13, 2021, 4:28pm UTC](https://discourse.julialang.org/t/julia-shared/59213/4 "2021-04-13T16:28:21Z")

</div>

Whats the point of that? The only version specific things in `.julia` is really the the default package environment, and that is already versioned by default.

---

<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: [April 13, 2021, 4:41pm UTC](https://discourse.julialang.org/t/julia-shared/59213/5 "2021-04-13T16:41:30Z")

</div>

Also, different users owning different directories and files is a recipe for a permissions nightmare

---

<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: [April 13, 2021, 5:14pm UTC](https://discourse.julialang.org/t/julia-shared/59213/6 "2021-04-13T17:14:22Z")

</div>

`DEPOT_PATH` already has versioned shared locations. Could you not just use those?

```julia
julia> DEPOT_PATH
3-element Vector{String}:
 "~/.julia"
 "~/julia-1.6.0/local/share/julia"
 "~/julia-1.6.0/share/julia"

```

---

<div class="post-metadata">

### Author: ![marllos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marllos/32/205917_2.png) [@marllos](https://discourse.julialang.org/u/marllos)
#### Post date: [April 13, 2021, 5:19pm UTC](https://discourse.julialang.org/t/julia-shared/59213/7 "2021-04-13T17:19:37Z")

</div>

Ok, but the goal would be to keep the previous version available for a while and also to understand how it works.

---

<div class="post-metadata">

### Author: ![marllos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marllos/32/205917_2.png) [@marllos](https://discourse.julialang.org/u/marllos)
#### Post date: [April 13, 2021, 5:21pm UTC](https://discourse.julialang.org/t/julia-shared/59213/8 "2021-04-13T17:21:15Z")

</div>

I don’t think I know how to use it, but I’ll do it the standard way anyway.

---

<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: [April 13, 2021, 5:24pm UTC](https://discourse.julialang.org/t/julia-shared/59213/9 "2021-04-13T17:24:43Z")

</div>

[https://docs.julialang.org/en/v1/base/constants/#Base.DEPOT\_PATH](https://docs.julialang.org/en/v1/base/constants/#Base.DEPOT_PATH)

> The first entry is the “user depot” and should be writable by and owned by the current user. The user depot is where: registries are cloned, new package versions are installed, named environments are created and updated, package repos are cloned, newly compiled package image files are saved, log files are written, development packages are checked out by default, and global configuration data is saved. Later entries in the depot path are treated as read-only and are appropriate for registries, packages, etc. installed and managed by system administrators.

---

<div class="post-metadata">

### Author: ![marllos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marllos/32/205917_2.png) [@marllos](https://discourse.julialang.org/u/marllos)
#### Post date: [April 13, 2021, 5:52pm UTC](https://discourse.julialang.org/t/julia-shared/59213/10 "2021-04-13T17:52:27Z")

</div>

My main goal is to keep Julia always up to date, but what about the other users? When I update Julia, they also have to update their .julia, I wish I could do this for them, but I don’t know how. If I don’t, Julia will become outdated.

---

<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: [April 13, 2021, 8:02pm UTC](https://discourse.julialang.org/t/julia-shared/59213/11 "2021-04-13T20:02:38Z")

</div>

`~/.julia` contains packages that individual users installed. User environments are versioned according `major.minor`. My 1.5 environment is distinct from my 1.6 environment.

You can upgrade base Julia for the users, but I really don’t recommend upgrading their environments for them. You really don’t want to be constantly updating packages without purposely doing so because code could potentially break.

---

<div class="post-metadata">

### Author: ![marllos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marllos/32/205917_2.png) [@marllos](https://discourse.julialang.org/u/marllos)
#### Post date: [April 13, 2021, 10:31pm UTC](https://discourse.julialang.org/t/julia-shared/59213/12 "2021-04-13T22:31:14Z")

</div>

OK, thank you very much.
