# Using Julia package manager offline

**URL:** https://discourse.julialang.org/t/using-julia-package-manager-offline/17773
**Category:** General Usage
**Tags:** package-manager
**Created:** [November 20, 2018, 2:08pm UTC](https://discourse.julialang.org/t/using-julia-package-manager-offline/17773 "2018-11-20T14:08:17Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![alirezamecheng](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@alirezamecheng](https://discourse.julialang.org/u/alirezamecheng)
#### Post date: [November 20, 2018, 2:08pm UTC](https://discourse.julialang.org/t/using-julia-package-manager-offline/17773/1 "2018-11-20T14:08:17Z")

</div>

We recently decided to make Julia Language available on our cluster systems. The cluster system is not able to connect to the internet. Is there any way to download all Julia packages and make them available for our different users to install and use them offline?

Another option that we have is a system that can connect to the internet temporarily, but it is always connected to the main cluster system. Is there any way to use this system as a mirror for the Julia packages or not?

We want to use “Julia 1.0.1”.

our cluster operation system is: "CentOS 5.5

notes: I have seen the question asked before [here](https://stackoverflow.com/questions/33751848/how-to-install-julia-packages-offline), but it is for Julia 0.6 and a single package that will be copied by hand. I want that user uses the `Pkg.add <pkgName>` command but instead of the internet, the package manager gets the packages from our offline system.

Thank you for your help and time.

---

<div class="post-metadata">

### Author: ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)
#### Post date: [November 20, 2018, 2:21pm UTC](https://discourse.julialang.org/t/using-julia-package-manager-offline/17773/2 "2018-11-20T14:21:49Z")

</div>

xref: [Using Julia package manager offline - Stack Overflow](https://stackoverflow.com/questions/53394757/using-julia-package-manager-offline)

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [November 20, 2018, 2:52pm UTC](https://discourse.julialang.org/t/using-julia-package-manager-offline/17773/3 "2018-11-20T14:52:19Z")

</div>

See some discussion in [How does one set up a centralized Julia installation?](https://discourse.julialang.org/t/how-does-one-set-up-a-centralized-julia-installation/13922) and [How to create a system administrator depot?](https://discourse.julialang.org/t/how-to-create-a-system-administrator-depot/14122)

---

<div class="post-metadata">

### Author: ![alirezamecheng](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@alirezamecheng](https://discourse.julialang.org/u/alirezamecheng)
#### Post date: [November 21, 2018, 10:51am UTC](https://discourse.julialang.org/t/using-julia-package-manager-offline/17773/4 "2018-11-21T10:51:38Z")

</div>

thanks for the discussion links.  
A question:  
How can I get latest Julia packages for Julia 1.0 so that I can have them available offline?

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [November 21, 2018, 11:05am UTC](https://discourse.julialang.org/t/using-julia-package-manager-offline/17773/5 "2018-11-21T11:05:30Z")

</div>

Nothing short of adding them manually I think. I have thought about something like

```julia
pkg> registry instantiate

```

to “instantiate” a registry, that is, download all the packages in there, similar to how you can instantiate a `Manifest.toml` to get all packages in there.

---

<div class="post-metadata">

### Author: ![alirezamecheng](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@alirezamecheng](https://discourse.julialang.org/u/alirezamecheng)
#### Post date: [December 3, 2018, 2:04pm UTC](https://discourse.julialang.org/t/using-julia-package-manager-offline/17773/6 "2018-12-03T14:04:36Z")

</div>

I did this and it seems to work for me but with a problem!  
First, by `userA` I add all the packages. But I don’t `precompile` anything.  
Then I open the Julia in `userB` terminal and execute this command to push the `userA``DEPOT_PATH` into `userB` `DEPOT_PATH`.

`push!(DEPOT_PATH,"/home/userA/.julia")`

the result is something like this:

```julia
3-element Array{String,1}:
 "/home/userB/.julia"                                   
 "/home/userB/julia-1.0.2/local/share/julia"
 "/home/userB/julia-1.0.2/share/julia"      
 "/home/userA/.julia"

```

Now when I use `add [packageName]` the Julia uses the added packages from the ` userA` (“/home/userA/.julia”) path, and when I use `precompile` the results files will be stored in `userB` directory (“/home/userB/.julia”). By this way, There is no need to copy packages for all users, and each user can have different projects, etc.

But I have a problem. It is necessary to execute `push!` command every time a user starts Julia. I tried using `export JULIA_DEPOT_PATH` The result is:

```julia
1-element Array{String,1}: 
 "/home/userA/.julia"

```

and it causes an error when using packages (obviously because the userB has not permission to write in the userA directory).  
It is needed to have all for paths in `DEPOT_PATH`.

Is there any way to set these 4 paths for each user without using `push!` command when a user starts Julia? I mean for example in bash or even by changing soething in julia source codes?

---

<div class="post-metadata">

### Author: ![alirezamecheng](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@alirezamecheng](https://discourse.julialang.org/u/alirezamecheng)
#### Post date: [December 4, 2018, 6:28am UTC](https://discourse.julialang.org/t/using-julia-package-manager-offline/17773/7 "2018-12-04T06:28:56Z")

</div>

I found the answer.  
There is a file named `startup.jl` in the `julia-1.0.2/etc/julia` path. anything in this file will be executed before the startup of Julia.  
so I puted the `push!()` command inside this file and It’s done.  
🙂
