# Running several versions of Julia

**URL:** <https://discourse.julialang.org/t/running-several-versions-of-julia/45221>\
**Category:** General Usage\
**Tags:** question\
**Created:** [August 19, 2020, 5:20pm UTC](https://discourse.julialang.org/t/running-several-versions-of-julia/45221 "2020-08-19T17:20:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cscherrer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cscherrer/32/7631_2.png) [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Post date:** [August 19, 2020, 5:20pm UTC](https://discourse.julialang.org/t/running-several-versions-of-julia/45221/1 "2020-08-19T17:20:39Z")

</div>

Hi,

**tl;dr What’s the best way to easily switch back and forth between multiple Julia versions?**

# System Config

First, my setup… I have a Linux machine with a `julia` directory containing

```julia-auto
chad@boondoggle:~/julia
➤ tree -L 2
.
├── julia-1.4.2
│ ├── bin
│ ├── etc
│ ├── include
│ ├── lib
│ ├── libexec
│ ├── LICENSE.md
│ └── share
└── julia-1.5.0
    ├── bin
    ├── etc
    ├── include
    ├── lib
    ├── libexec
    ├── LICENSE.md
    └── share

```

Then, my `~/.local/bin` (which is in my `$PATH`) has symbolic links

```julia-auto
julia14 -> julia-1.4.2/bin/julia
julia15 -> julia-1.5.0/bin/julia
julia -> julia15

```

The idea here is that it’s really easy to call either at the command line, or to change `~/.local/bin/julia` point to whichever I want to consider the default.

# The Problem

I’d like to be able to do this without clobbering my `.julia` directory each time I switch. Is there anything special I need to do? Environment variables, etc?

More generally, is this a reasonable way to set things up for switching back and forth? Any other recommendations to make this easier?

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [August 19, 2020, 5:26pm UTC](https://discourse.julialang.org/t/running-several-versions-of-julia/45221/2 "2020-08-19T17:26:04Z")

</div>

> [@cscherrer](#):
>
> I’d like to be able to do this without clobbering my `.julia` directory each time I switch. Is there anything special I need to do? Environment variables, etc?

This should be totally fine. Each minor version of Julia has its own global package environment, so installing something in Julia 1.4 won’t affect what you have in Julia 1.5. All of your Julia versions will share the same cache of (immutable) package downloads, but they can use different packages and different versions without you doing anything special.

> [@cscherrer](#):
>
> More generally, is this a reasonable way to set things up for switching back and forth? Any other recommendations to make this easier?

This is almost exactly what I do, and it has worked well for me for a long time.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [August 19, 2020, 6:54pm UTC](https://discourse.julialang.org/t/running-several-versions-of-julia/45221/3 "2020-08-19T18:54:11Z")

</div>

> [@rdeits](#):
>
> This is almost exactly what I do, and it has worked well for me for a long time.

+1, works well for me as well.

---

<div class="post-metadata">

**Author:** ![cscherrer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cscherrer/32/7631_2.png) [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Post date:** [August 19, 2020, 6:56pm UTC](https://discourse.julialang.org/t/running-several-versions-of-julia/45221/4 "2020-08-19T18:56:52Z")

</div>

Great, thank you both. I’m hitting some errors, but I think it must be a bug in the application. Very helpful to be able to rule out system setup as the culprit. 🙂
