# Is there a simple Julia upgrade command?

**URL:** <https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691>\
**Category:** General Usage\
**Created:** [August 27, 2020, 8:23am UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691 "2020-08-27T08:23:09Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [August 27, 2020, 8:25pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/21 "2020-08-27T20:25:02Z")

</div>

Deleting .julia has no effect whatsoever for me. Of course, YMMV. People employ all sorts of tricks, which occasionally backfire.

I have now developed a portable version of Julia, with a completely local depot and Julia installation tree. I have tested many times, each time deleting everything and rebuilding from scratch. Never had any problem.

---

<div class="post-metadata">

**Author:** ![Vasily\_Pisarev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vasily_pisarev/32/7929_2.png) [@Vasily\_Pisarev](https://discourse.julialang.org/u/Vasily_Pisarev)\
**Post date:** [August 27, 2020, 8:29pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/22 "2020-08-27T20:29:53Z")

</div>

Julia looks up files at `C:\Users\⟨username⟩\.julia`.  
It’s easiest to set up a `startup.jl` file and put it in `.julia\config`. E.g., to check if your favorite packages are installed on REPL start and install if they’re missing:

```julia
atreplinit() do repl
    @eval using Pkg
    let pkgs = ["BenchmarkTools", "Revise"] # put here all the packages you want to install
        for pkg in pkgs
            if Base.find_package(pkg) |> isnothing
                @eval Pkg.add($pkg)
            end
        end
    end
 end

```

---

<div class="post-metadata">

**Author:** ![vf30kf](https://avatars.discourse-cdn.com/v4/letter/v/49beb7/32.png) [@vf30kf](https://discourse.julialang.org/u/vf30kf)\
**Post date:** [August 27, 2020, 8:30pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/23 "2020-08-27T20:30:00Z")

</div>

> [@Julia v1.5.1 has been released](https://discourse.julialang.org/t/julia-v1-5-1-has-been-released/45583/22):
>
> > [@vf30kf](#):
> >
> > I just finished upgrading to 1.5.1 and I would like to NOT have to re-install all the packages that I downloaded for the previous version. Is there an easy way to tell Julia 1.5.1 where my packages are at? Or will I have re-install each package I was previously using?
> 
> If you upgraded from Julia 1.5.0 you shouldn’t have to do anything. If you upgraded from Julia 1.4.X you can copy `.julia/environments/v1.4` to `.julia/environments/v1.5` (just two text files).

Thank you for your help! That worked like a charm on standalone and Atom/Juno!

I have one lingering issue from this upgrade to 1.5.1. And maybe this is the wrong thread, but how do tell Jupyter Notebooks that I removed version 1.4.2 and am now using 1.5.1. I am using the Notebooks environment from Anaconda3 (Navigator v 1.9.12), just fyi.

I did try typing `using IJulia` and then `notebook()` since this is what I had previously done.

Again, I am a relative newbie. And as always, thank you very much for your help!

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [August 27, 2020, 8:54pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/24 "2020-08-27T20:54:40Z")

</div>

> [@PetrKryslUCSD](#):
>
> All it takes is around five minutes to get it back through a reinstallation.

Five minutes of efficiently doing exactly the right things translates to half an hour of googling and swearing, and reading the documentation of symlinks, and searching through the forum after half-remembered advice on package copying.

I sometimes postpone updating for weeks or months because of this. Doing `something Julia update`, is an incredible improvement.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [August 27, 2020, 9:02pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/25 "2020-08-27T21:02:02Z")

</div>

I don’t know why. I use Julia on Linux all the time, I simply unzip the tar file and that’s it.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [August 27, 2020, 9:02pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/26 "2020-08-27T21:02:56Z")

</div>

By the way, rebuilding the portable version amounts to double-clicking a script file.  
Let me know if you’re interested. (That is, if your thing is Windows.)

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [August 27, 2020, 9:06pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/27 "2020-08-27T21:06:25Z")

</div>

You have to install to the correct folder, and figure out the symlinks, and fix the package stuff/toml-files. That doesn’t happen by itself by unzipping. I don’t understand.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [August 27, 2020, 9:20pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/28 "2020-08-27T21:20:01Z")

</div>

???  
This is what I do: Remove .julia and

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/d/9d4ccbbaf498058eae76edfdd94f1654758c9915.png)

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [August 27, 2020, 9:22pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/29 "2020-08-27T21:22:37Z")

</div>

I’ve heard [asdf](https://asdf-vm.com/#/) recommended, and I used it today and it seemed pretty nice and easy. It’s a generic version manager with a Julia plugin (you just do `asdf plugin add Julia` once `asdf` is installed to add the Julia plugin). Then e.g. `asdf install julia` installs Julia 1.5.1, or `asdf install julia 1.0` installs version 1.0. And `asdf global julia 1.5.1` sets `julia` to point at Julia 1.5.1.

edit: I wrote a longer version of this answer at [How to update Julia from command line? - Stack Overflow](https://stackoverflow.com/a/63694160/12486544)

---

<div class="post-metadata">

**Author:** ![ianfiske](https://avatars.discourse-cdn.com/v4/letter/i/58f4c7/32.png) [@ianfiske](https://discourse.julialang.org/u/ianfiske)\
**Post date:** [August 27, 2020, 9:41pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/30 "2020-08-27T21:41:34Z")

</div>

I think some users might lose data unexpectedly by deleting `~/.julia`. In particular

- Any dev’d packages they are working on inside of `~/.julia/dev`. This could be major work loss if they didn’t commit/push in a while.
- Any startup config they have in `~/.julia/config/startup.jl`

There might be other losses I’m unaware of. Just a note to suggest that maybe we exercise some caution before recommending new users blast `~/.julia`.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [August 27, 2020, 9:46pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/31 "2020-08-27T21:46:34Z")

</div>

True. However I think the best thing to do is to develop packages _outside_ of the .julia folder.  
Consider just the inconvenience of having to locate the source files.

I think a good practice would be to consider the entire .julia folder as read-only for the user. Remove any time. Storing stuff in this folder always seemed sketchy to me.

The loss of the configuration file could be painful, unless the users had the foresight to commit this file to a repo established for that purpose. That is how I do it, if a start up file is indicated.

By the way, I do use a startup file in the portable Julia installation. It is generated automatically, however.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [August 27, 2020, 9:50pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/32 "2020-08-27T21:50:02Z")

</div>

The portable Windows Julia installation is available here [http://hogwarts.ucsd.edu/~pkrysl/shared/Portable\_Julia.zip](http://hogwarts.ucsd.edu/~pkrysl/shared/Portable_Julia.zip)

Instructions: [https://github.com/PetrKryslUCSD/dynamics-course-2020](https://github.com/PetrKryslUCSD/dynamics-course-2020)

It installs some packages you may not be interested in, but otherwise it is a fairly general  
artifact. Feel free to tweak the installation script to suit your needs.

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [August 27, 2020, 9:50pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/33 "2020-08-27T21:50:39Z")

</div>

On Mac:

```julia
brew install julia

```

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [August 27, 2020, 9:53pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/34 "2020-08-27T21:53:08Z")

</div>

It’s true that if you use project files and manifests then your `.julia` should mostly be one big, complicated cache. Feels like blowing it away shouldn’t be necessary though—I never do. But it’s pretty excellent that reinstalling everything, even binary dependencies, is so reliable and quick that this is fine to do. Worth taking a moment to appreciate.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [August 27, 2020, 10:32pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/35 "2020-08-27T22:32:53Z")

</div>

> [@PetrKryslUCSD](#):
>
> ? ??  
> This is what I do: Remove .julia and

I’m sure this is all well and good. But it seems a _lot_ more complicated and advanced than what you indicated at first.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [August 27, 2020, 10:52pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/36 "2020-08-27T22:52:46Z")

</div>

Really? It is literally a single-line to make the installation happen (extract the tar file).  
Then, for each package that I want to work on I clone it, activate it, instantiate it.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [August 27, 2020, 11:48pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/37 "2020-08-27T23:48:59Z")

</div>

This discussion has happened many times before

> [@Julia v1.4.0 has been released](https://discourse.julialang.org/t/julia-v1-4-0-has-been-released/36324/20):
>
> Instead of rm -rf ~/.jullia it’s better to recommend mv ~/.julia ~/.julia.bak, which is safer. I’m just pointing this out because I don’t want people to accidentally delete their work.

Instead of deleting, it’s always been sufficient for me to transfer the `environments` folder to upgrade.

---

<div class="post-metadata">

**Author:** ![tchr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tchr/32/15138_2.png) [@tchr](https://discourse.julialang.org/u/tchr)\
**Post date:** [August 28, 2020, 1:35am UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/38 "2020-08-28T01:35:23Z")

</div>

It might potentially be helpful for newcomers if the Windows installer could ask whether environments should be transferred from any existing Julia installs.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [August 28, 2020, 4:17am UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/39 "2020-08-28T04:17:05Z")

</div>

> [@PetrKryslUCSD](#):
>
> Then, for each package that I want to work on I clone it, activate it, instantiate it.

You lost me. I want to bring with me, say, 30 packages from the previous version. The process you describe here seems vastly more laborious than the manual procedure I already use. Not to mention the super simple update scripts in Jill.py.

And also, you have to fix the symlink stuff, which always takes me quite a bit of time.

I mean, why would I google each package individually to get their url and git clone them, instead of doing Pkg.add? Or just copy over the manifest/project files?

I’m just mystified because your response seems to be: “Why would you spend 2 seconds updating with Jill/chocolatey, when you could spend five minutes doing [complicated and confusing process]?”

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [August 28, 2020, 2:11pm UTC](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691/40 "2020-08-28T14:11:20Z")

</div>

I think you missed that (1) I cloned the package I wanted to develop (edit its files etc), and (2) I used project files to get all the packages that the developed package depends on.

I don’t know if by “30 packages from the previous version” you mean that they were used in your work, but if so, I “brought with me” all of that stuff with “activate .; instantiate”.

And what symlinks are you talking about?

[Previous page](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691.md?page=1)

[Next page](https://discourse.julialang.org/t/is-there-a-simple-julia-upgrade-command/45691.md?page=3)
