Questions related to updating Julia

I’m on Mac OS Venture 13.1 and am trying to upgrade from my current v1.7 to v1.8.5.After downloading and installing the dmg file now I have both versions in my Application folder.

How should I remove the old version and link all of the Julia packages to the new version?

What would I need to do to make sure the next time I run “julia xxx.jl” in a terminal, it will execute the new version of Julia?

Many thanks.

Both can coexist just fine, and you need not worry about Julia’s packages — they’ll sort themselves out as needed within the environments that you use.

How you change what julia refers to in your terminal, however, depends upon how you set it up in the first place. There are lots of ways you might have done this — you may have used a symlink or a shell alias or changed your PATH. One way to jog your memory is with the command type julia in the terminal — that’ll tell you how the terminal resolves the command. If it’s just a path /Applications/Julia-..., then you probably modified your $PATH variable in some shell setup file. You just need to find where you changed your path and update it with the new path for v1.8.

1 Like

Actually, which julia will tell you precisely which executable will fire.

1 Like

I know about which; using type here was intentional as I’ve found it to be slightly more robust: shell - How to use `which` on an aliased command? - Unix & Linux Stack Exchange

I suppose it doesn’t matter as much now that most folks on macOS will be using zsh, but on bash it definitely can cause confusion(1).

2 Likes

Ah, that’s good to know.

Many thanks!

I updated the path below:
sudo ln -s /Applications/Julia-1.8.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia

Unfortunately, it seems that I would need to reinstall all the packages again. What am I missing?