I have installed julia. I want all the package I installed to be available
to other group members. So I want to change JULIA_PKGDIR from ~/.julia to
/opt/.julia. I do it by add the following line:
ENV["JULIA_PKGDIR"] = "/opt/.julia"
to the file ~/.juliarc.ji.
Although I have sudo privilege, when I start julia with
sudo Julia
I get the following:
ERROR: stat: permission denied (EACCES)
in stat at stat.jl:40
in try_include at client.jl:219
in load_juliarc at client.jl:356
in _start at client.jl:391
but if I start julia with just: julia
and then
julia> Pkg.add("JuMP")
I got the following error:
ERROR: Package metadata directory /opt/.julia/v0.4/METADATA doesn't exist;
run Pkg.init() to initialize it.
in error at error.jl:21
in cd at pkg/dir.jl:28
in add at pkg.jl:23
if I do
julia> Pkg.init()
I got:
INFO: Initializing package repository /opt/.julia/v0.4
ERROR: SystemError: mkdir: Permission denied
in mkdir at file.jl:42
in mkpath at file.jl:50
in mkpath at file.jl:49
in mkpath at file.jl:46
in init at pkg/dir.jl:48
in init at pkg.jl:19
finally, if I do
julia> sudo Pkg.init()
I got:
ERROR: syntax: extra token "Pkg" after end of expression
Is there any way to achieve my goal? Thank you very much in advance.
Yankai