Error when updating Julia via UpdateJulia

I am currently using Julia version 1.7.2. on macOS Monterey with an arm processor, When I tried updating to 1.8.3 via the UpdateJulia package I received the following permission error

/dev/disk4              GUID_partition_scheme          
/dev/disk4s1            EFI                            
/dev/disk4s2            Apple_HFS                       /Volumes/Julia-1.8.3
"disk4" ejected.
ln: /usr/local/bin/julia: Permission denied
ERROR: failed process: Process(`ln -sf /Applications/Julia-1.8.3.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia`, ProcessExited(1)) [1]

Stacktrace:
 [1] pipeline_error
   @ ./process.jl:531 [inlined]
 [2] run(::Cmd; wait::Bool)
   @ Base ./process.jl:446
 [3] run
   @ ./process.jl:444 [inlined]
 [4] link(executable::String, bin::String, command::String, systemwide::Bool, v::VersionNumber)
   @ UpdateJulia ~/.julia/packages/UpdateJulia/TwtsF/src/UpdateJulia.jl:374
 [5] update_julia(version::String; os_str::String, arch::String, prefer_gui::Bool, fetch::Bool, _v_url::Tuple{VersionNumber, String}, v::VersionNumber, migrate_packages::Bool, url::String, aliases::Vector{String}, systemwide::Bool, install_location::String, bin::String, dry_run::Bool, verbose::Bool)
   @ UpdateJulia ~/.julia/packages/UpdateJulia/TwtsF/src/UpdateJulia.jl:221
 [6] update_julia(version::String)
   @ UpdateJulia ~/.julia/packages/UpdateJulia/TwtsF/src/UpdateJulia.jl:158
 [7] update_julia()
   @ UpdateJulia ~/.julia/packages/UpdateJulia/TwtsF/src/UpdateJulia.jl:169
 [8] top-level scope
   @ REPL[9]:1

Just wondering if there was a quick fix to this and if it is recommended to update to 1.8 from 1.7? Any tips would be appreciated thanks!

You might be able to do

update_julia(; systemwide=false)
1 Like

Thanks so much! I think this installed 1.8 as It is says that packages have been migrated from 1.7 to 1.8. However when I restart Julia and check version I am still getting

VERSION
v"1.7.2"

How do you launch julia?

I launched it through VScode?

1 Like

thanks for helping with this! so when I ran update_julia(; systemwide=false) it said

Please add /Users/kat/.local/bin to path

but when I added it to Julia:Executable Path I keep getting a system error in Julia. So I tried to check if I had the right path, but when I typed whereis Julia into terminal it just returns :Julia . I tried updating VScode but that didn’t seem to do anything.

Try making Julia: Executable Path

/Users/kat/.local/bin/julia
1 Like

Wow that did it! thanks so much it would’ve taken me days without your help!

This is a sum up of all of @jd-foster’s answers for future reference and any other less savvy novices since I asked so many questions to get it working.

to update Julia within the REPL try

]add UpdateJulia
using UpdateJulia
update_julia()

if this does not work try

update_julia(; systemwide=false)

UpdateJulia will then display the following message:

Please add /Users/user/.local/bin to path

In VSCode:

  1. Click on Extensions on the left hand side
  2. Select or type in Julia.
  3. Click on the gear icon
  4. Select Extension Settings
  5. Under Julia: Executable Path - paste the path provided by UpdateJulia + /julia so
/Users/user/.local/bin/julia

You can check if the updated version is installed by typing VERSION into the REPL and update packages with
]up

2 Likes

For future reference UpdateJulia is now deprecated and unmaintained - Update with juliaup instead as noted by ufechner7 here