UpdateJulia

Updating Julia should be easy. The easier it is, the more likely folks will develop with the latest versions, and the less friction we will have with fast paced language development.

Currently, it is challenging. There are several long, unresolved discourse threads on the topic, 3rd party instructions galore, and more instructions.

The situation is summed up quite well in this concise question and its first answer

We have jill.py, but one of the great attractions of julia is that it is self contained.

Introducing UpdateJulia — a simple cross platform julia installer! :smiley:

]add UpdateJulia
using UpdateJulia
update_julia()
40 Likes

Very nice package! It makes me feel silly for doing all of the downloading and symbolic linking manually this entire time. Does this support installing release candidates as well?

1 Like

Yes!

julia> update_julia("1.7.0-rc3")
installing julia 1.7.0-rc3
This version is out of date. The latest official release is 1.7.0
[...]

Right now, there are no prereleases available for 1.8, but when there are,

julia> update_julia("1.8")
ERROR: ArgumentError: No released versions starting with "1.8"
Stacktrace:
[...]

Should give the latest one. Digging through internals we find these recently released versions:

sort(collect(filter(x -> x >= v"1.6", keys(UpdateJulia.versions[]))))
13-element Vector{VersionNumber}:
 v"1.6.0"
 v"1.6.1"
 v"1.6.2"
 v"1.6.3"
 v"1.6.4"
 v"1.7.0-beta1"
 v"1.7.0-beta2"
 v"1.7.0-beta3"
 v"1.7.0-beta4"
 v"1.7.0-rc1"
 v"1.7.0-rc2"
 v"1.7.0-rc3"
 v"1.7.0"

You can use update_julia("nightly") to get 1.8 today, but the installed version of Julia will likely be buggy and not appropriate for most users. Further, UpdateJulia only supports nightlies on Mac and Windows.

3 Likes

Nice! Out of curiosity, what’s the reason nightlies are not supported on Linux?

Because there is a bug in the code I haven’t gotten around to fixing :slight_smile:
EDIT: they are supported in UpdateJulia v0.2.1

2 Likes

The links for the documentation don’t work.

The README should be a complete guide & documentation. That there are broken links is bad, but I’m not sure how to fix them.
EDIT: this post helped me make the link work, but the readme is probably still a better guide atm.

2 Likes

Is there any relation to juliaup (GitHub - JuliaLang/juliaup: Julia installer and version multiplexer)?

Nope!

I released UpdateJulia in early November 2021 for the user base of folks who already have a (possibly out of date) Julia version installed and want lightweight version instilation and management within the Julia ecosystem. At that time juliaup was a “experimental MSIX installer for Julia for the Windows Store” according to it’s readme.md, and the only other alternative was jill, a linux-only tool.

A few months later, I’m glad to see that juliaup has expanded to more opperating systems! For folks who already have Julia (e.g. most of the people on discourse) I think it is hard to beat the Julia package archetecture (e.g. Users can install and use all of UpdateJulia’s functioanlity without leaving a Julia REPL (REPL restart is still required to switch Julia versions), and UpdateJulia has about 8x fewer SLOC than juliaup).

It’s good to see that folks are addressing the use case of installing Julia for the first time, but I’m worried that this may also call for an automatic juliaup installer :wink: .

I hope Julia will officially ship with one of these installers / updaters. Fragmentation in this area is no big deal but still unfortunate for newcomers.

1 Like

There are many different ways to install juliaup, all very platform dependent. BUT, all of them handle updates to juliaup itself. When juliaup is installed via one of the various system package stories (at the moment that would be Windows Store, brew and AUR) we utilize the update features of those, and if it is installed in standalone mode via the new script based install on Mac and Linux it ships with a very comprehensive update mechanism.

Technically one can do something similar via shell mode with juliaup. I could also see some future version integrate a bit closer into Julia itself, but at the moment the focus is to really get the basic functionality rock solid and working on all platforms.

5 Likes

Hi, I am trying to use this package but coming across an error with the message below that I can’t understand.

Error: The Julia launcher failed to figure out which juliaup channel
to use.
ERROR: TypeError: non-boolean (Missing) used in boolean context
Stacktrace:
 [1] filter(f::UpdateJulia.var"#34#35"{VersionNumber}, a::Vector{Stri
ng})
   @ Base .\array.jl:2484
 [2] report(commands::Vector{String}, v::VersionNumber)
   @ UpdateJulia C:\Users\LG\.julia\packages\UpdateJulia\TwtsF\src\Up
dateJulia.jl:412
 [3] update_julia(version::String; os_str::String, arch::String, pref
er_gui::Bool, fetch::Bool, _v_url::Tuple{VersionNumber, String}, v::V
ersionNumber, migrate_packages::Bool, url::String, aliases::Vector{St
ring}, systemwide::Bool, install_location::String, bin::Nothing, dry_
run::Bool, verbose::Bool)
   @ UpdateJulia C:\Users\LG\.julia\packages\UpdateJulia\TwtsF\src\Up
dateJulia.jl:225
 [4] update_julia(version::String)
   @ UpdateJulia C:\Users\LG\.julia\packages\UpdateJulia\TwtsF\src\Up
dateJulia.jl:158
 [5] update_julia()
   @ UpdateJulia C:\Users\LG\.julia\packages\UpdateJulia\TwtsF\src\Up
dateJulia.jl:169
 [6] top-level scope
   @ REPL[4]:1

May I ask how to solve this error? Thank you for the fantastic package!

Error: The Julia launcher failed to figure out which juliaup channel
to use.

This is an error thrown by juliaup (different from UpdateJulia.jl). Nevertheless, I think I should be able to fix this on my end. I’ve published a patch that should go live in the General registry in 15 minutes.

@Lilith thanks for sharing above methods to update julia version. I’m a newbie in julia and trying to upgrade from Julia version 1.6.6 to 1.6.7.
I tried to install UpdateJulia but getting below error. Any suggestions/input would be appreciated. Also, is there any other methods I can use as alternative to upgrade julia version.
Below is the error -

julia> import Pkg; Pkg.add("UpdateJulia")

Resolving package versions...

ERROR: Unsatisfiable requirements detected for package Distributions [31c24e10]:

Distributions [31c24e10] log:

├─Distributions [31c24e10] has no known versions!

Distributions is not a direct or indirect dependency of UpdateJulia, so this may be an issue due to other htings in the environment you are using. You can try again in a fresh environment with

julia> import Pkg; Pkg.activate("UpdateJulia"; shared=true); Pkg.add("UpdateJulia")
  Activating new environment at `~/.julia/environments/UpdateJulia/Project.toml`
    Updating registry at `~/.julia/registries/General`
   Resolving package versions...
    Updating `~/.julia/environments/UpdateJulia/Project.toml`
  [770da0de] + UpdateJulia v0.4.2
    Updating `~/.julia/environments/UpdateJulia/Manifest.toml`
  [682c06a0] + JSON v0.21.3
  [69de0a69] + Parsers v2.5.2
  [66db9d55] + SnoopPrecompile v1.0.1
  [fd094767] + Suppressor v0.2.1
  [770da0de] + UpdateJulia v0.4.2
  [ade2ca70] + Dates
  [a63ad114] + Mmap
  [de0858da] + Printf
  [4ec0a83e] + Unicode
Precompiling project...
  5 dependencies successfully precompiled in 21 seconds

julia> using UpdateJulia

julia> update_julia("1.6")
installing julia 1.6.7
...

Yes! juliaup is a great alternative. If you are on mac or linux you can install 1.6.7 with these shell commands

~ $ curl -fsSL https://install.julialang.org | sh
~ $ juliaup add lts
~ $ julia +lts

(“lts” stands for long term support)

2 Likes

Hi, and welcome to Julia! If you’re a new user and can install newer versions on your computer, chances are you’d be better off using the newest full release (1.8).

1 Like