Is there a simple Julia upgrade command?

Hi, can we update Julia just inside Julia by running a command like update, rather than download a new version from website? :smiley:

2 Likes

AFAIK not, but you can use a script like

3 Likes

Thanks you, that seems to be a workaround.

I will try it next time, since I just update both my mac and linux version manually :grinning:

I just installed 1.5.1 using https://github.com/johnnychen94/jill.py which is a python fork of the same script, with apparently some extra features. It was really easy, I just called

$ jill install

and it installed the latest version, and even found all my previously installed packages, though I hadn’t used Jill before.

As a relatively (well, very) new linux user, I am slightly confused about all the different install folder conventions going around. I never know if I should install in /usr/local/bin or /opt/ or whatever else (I don’t remember all the different ones I’ve seen). I installed Anaconda (python) earlier today, which put everything in ~/Anaconda3/ :confused:

Jill by default installs to ~/packages/julias/ with symlinks in ~/.local/bin which was a totally new place for me. I wonder if there is some conventional wisdom on this. For now, my various different pieces of software are scattered all over the place.

If your machine is single-user, this is the best place. There is simply no need for anything that would require sudo or root access.

4 Likes

Yes, it is. Thanks, I’ll keep that in mind.

My config stuff is in ~/.julia, but now I wonder if it should be in ~/.local/.julia ehh. or somewhere like that.

My usual puff for those using Windows - consider using the Chocolatey package manager.
Julia 1.5.1 is available - just run choco update julia

3 Likes

Congratulations on the progress, and on master:

$ ~/julia-1.4.0/bin/julia -q
julia> @time using Plots
 13.396186 seconds (13.81 M allocations: 773.200 MiB, 2.56% gc time)

vs. 1.5.1
  9.904794 seconds (11.06 M allocations: 640.073 MiB, 3.11% gc time)

vs. 1.6 master:
  5.579115 seconds (7.95 M allocations: 556.413 MiB, 5.02% gc time)

E.g. Gtk.jl has similar numbers, lower on master, higher on 1.4.0.

3 Likes

No, ~/.julia is fine. A lot of software makes hidden folders in the home directory like that. Ultimately, it’s up to you - I think these conventions are pretty lose, but my preference lately has been to have all of my user scripts (the things I write) symlinked in ~/bin, and executables from software I install symlinked in ~/.local/bin.

But config files and stuff I just put wherever the default is, because I can’t be bothered to change (and then remember) the paths to those things

6 Likes

Will I need to copy the environment (Project.toml, Manifest.toml) for upgrading from 1.5 to 1.5.1? And rebuild and recompile everything?

PS: If you’re on macOS, upgrading Julia itself is easy if you use Homebrew: brew cask upgrade julia

I also wish Julia used versioned binary names, ala julia-1.5, and symlinked the selected one into the bin directory. That way we could easily revert to our old versions if something broke on an upgrade. (I think asdf can do this, but asdf is buggy and slow.)

Update: Just checked out jill.py; Seems like it has my desired features!

1 Like

Home directory layout are not strongly standardized. ~/.local comes from the spec in

https://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Once you have a ~/.julia directory, you might as well have all the relevant stuff in it.

That said, one relevant consideration is backup exclusions, a lot of exclusion lists for backup tools ignore ~/.cache automatically, and one has to do the same for subdirectories in ~/.julia to avoid backing up gigabytes of files that can be downloaded/regenerated anytime.

This is so true. Almost painful to mention that upgrading Julia on Windows is easier than on Pop! OS.

A minor remark: ‘update’ is depreciated, it’s ‘upgrade’ now. Normally I do:

choco outdated         # show outdated apps
choco upgrade all -y   # upgrades everything
#choco upgrade julia   # (I seldom upgrade specific apps)

Imho it’s really well worth “wasting” the time to setup Chocolatey.

Honest question - what benefits do Chocolatey bring when updating Julia on Windows? I just run the new installer (and for x.1 releases copy over the package environment) and everything works just as usual. Are other people having serious upgrade headaches?

What you’re discribing here is actually a real inconvenience. Every time I forget how to handle environments/packages.On Linux/there’s also updating symlinks, not sure what you do on windows. But on linux/Macos it’s 5-10 minutes each time, enough that I often postpone updating for weeks.

Jill may have solved this for me. Although, when I used Jill to install a nightly build, it didn’t find my packages/environments :confused:

I think the answer to that question must be yes. I have used Julia on Windows for several years. Quite often I see people on here getting tied in knots with windows 10 installs, including newbies who are driven to tears of frustration.
Since using Chocolatey I have had a much better experience.

Th emost recent example was a thread on IJulia not installing properly. I admit in that case the person did not have Admin rights so Choco was not the answer.

I always use the standard Windows installer, and I’ve never had any problems.

1 Like

Speaking of newbies to Julia having frustrations. I guess I am in that camp.

Background info:

  • I am on Windows 10 (64-bit)
  • Julia binary is in: “C:\Users\myusrname\AppData\Local\Programs\Julia 1.5.1\bin\julia.exe”
  • Packages are in: “C:\Users\myusrname.julia”

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?

Since I am a relative newbie, if you can please explain it to me very basically. Thank you for your help.

If you don’t mind the wait, just reinstall from scratch. I delete the .julia folder regularly.
All it takes is around five minutes to get it back through a reinstallation.

2 Likes

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).

8 Likes

Oh wow. This is not a great recommendation for newbies :sweat_smile: I don’t think it should ever be necessary to delete .julia. At most, you might want to delete .julia/registries/General. Deleting .julia makes for a not-so-great user experience and I’ve seen it recommended a couple of times now.

:+1:

5 Likes