# Offline package installation

**URL:** <https://discourse.julialang.org/t/offline-package-installation/7880>\
**Category:** General Usage\
**Created:** [December 20, 2017, 3:41pm UTC](https://discourse.julialang.org/t/offline-package-installation/7880 "2017-12-20T15:41:42Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Hearns](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/john_hearns/32/1685_2.png) [@John\_Hearns](https://discourse.julialang.org/u/John_Hearns)\
**Post date:** [December 20, 2017, 3:41pm UTC](https://discourse.julialang.org/t/offline-package-installation/7880/1 "2017-12-20T15:41:42Z")

</div>

Julia packages live on Github, and unregistered packages can be installed usign a git clone.  
I guess it is easy enough to make a local copy of a repo on disk. How would one tell julia to install packages from that source, rather than Github?

The answer probably is in the documentation and is glaringly obvious.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [December 20, 2017, 3:43pm UTC](https://discourse.julialang.org/t/offline-package-installation/7880/2 "2017-12-20T15:43:07Z")

</div>

Why not just set it up locally and copy over your `.julia` folder?

---

<div class="post-metadata">

**Author:** ![John\_Hearns](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/john_hearns/32/1685_2.png) [@John\_Hearns](https://discourse.julialang.org/u/John_Hearns)\
**Post date:** [December 20, 2017, 3:46pm UTC](https://discourse.julialang.org/t/offline-package-installation/7880/3 "2017-12-20T15:46:27Z")

</div>

Chris - you mean prepare a copy at your home location, then bring the .julia folder to site.  
OK, that would work.  
I guess this is a use case for JuliaPro. You install JuliaPro and say “well - that is a certified and supported version - it should have everythign you need”

---

<div class="post-metadata">

**Author:** ![alea](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@alea](https://discourse.julialang.org/u/alea)\
**Post date:** [April 7, 2018, 5:21am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/4 "2018-04-07T05:21:15Z")

</div>

I like Julia very much and would like to promote its use in education.  
In fact, I used it as the reference language in a book I wrote about Stochastic Processes.  
I would like to propose Julia to be added on the list of accepted languages for the “agregation de mathématiques” in France (a national competition to hire math teachers as civil servants).  
Of course, applicants must work with the same environment, with the good packages already installed.  
Copying the .julia directory is just a dirty hack, not a real solution for the deployment.  
Even if we forget the context of a national contest, the problem is the same for the deployment of Julia in a teaching department.

Of course, Julia Pro could sound like a solution, but

- the licence prevents from copying the Personal version
- the Enterprise version is too expensive

This is really a strong issue which prevents me to go further in the promotion of Julia.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [April 7, 2018, 6:32am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/5 "2018-04-07T06:32:43Z")

</div>

> [@alea](#):
>
> Of course, applicants must work with the same environment, with the good packages already installed.
> 
> Copying the .julia directory is just a dirty hack, not a real solution for the deployment.

I am not sure why you replied in this topic — is offline _installation_ (not use, which I would understand) a requirement for these national competitions? In any case, for a perfectly reproducible environment, you can pin the exact versions in the `REQUIRE` file, or just use a Docker image. The latter should be trivial for any system administrator nowadays. It also allows would-be contestants to download the precise test environment and learn to work in it.

> [@alea](#):
>
> This is really a strong issue which prevents me to go further in the promotion of Julia.

Deployment should be the easiest problem to deal with when promoting Julia, especially in an institutional setting.

---

<div class="post-metadata">

**Author:** ![alea](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@alea](https://discourse.julialang.org/u/alea)\
**Post date:** [April 7, 2018, 7:43am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/6 "2018-04-07T07:43:42Z")

</div>

The competitions use a special bootable key, so yes, offline installation is mandatory.  
The guy which organizes it is not employed as a system administrator, he is a teacher whose work in this task is mainly pro bono.  
So, basically, if I can tell him just apt-get install julia julia-packages, the answer will probably be yes, but I can not ask him to plunge into the details of a software he has probably never used.

This post seems also related to these problems

> [@System wide Pkg installation](https://discourse.julialang.org/t/system-wide-pkg-installation/1402):
>
> Is there a way to install packages system wide alongside those added by users without duplication? I’d really like to be able to install (and precompile) a selection of commonly used packages in a system wide directory, then have users add only the packages they need without duplication. Whatever I’ve tried so far, Pkg.add (run by the user), resolves to a large tree of dependencies, most or all of which are already installed (system wide). When installing the system packages, I’m setting JULIA…

Perhaps I have to wait Pkg3

> <https://github.com/JuliaLang/Juleps/blob/master/Pkg3.md>

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [April 7, 2018, 7:59am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/7 "2018-04-07T07:59:01Z")

</div>

I am confused about the requirements, eg

> [@alea](#):
>
> offline installation is mandatory

but

> [@alea](#):
>
> I can tell him just apt-get install julia julia-packages

so I am not sure what needs to be offline and online.

Perhaps the person organizing this could ask questions here with the exact requirements and get more specific help.

> [@alea](#):
>
> The guy which organizes it is not employed as a system administrator, he is a teacher whose work in this task is mainly pro bono.

Many people do a lot of work without compensation in the free software world, so this situation is not uncommon. Nevertheless, if specific tools are needed, someone has to step up and invest the work. This looks like a problem that is solvable with some time investment, so maybe you could help him out? Basic Docker stuff can be learned in an afternoon, I did that for a [unit testing setup](https://github.com/tpapp/texlive-julia-minimal-docker) for a package.

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [February 7, 2019, 3:56am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/8 "2019-02-07T03:56:20Z")

</div>

I was really happy with how easy it was to install Julia on linux even though I have little Linux experience. Basically, just extract the zip file and I am done.

I got Julia v1 running Redhat Linux. How do I find out where `.julia` folder is? I understand I can just put the code there and it will recognise it.

And if I want to change it how do I do that? If I understand correctly [here](https://discourse.julialang.org/t/where-or-how-to-edit-depot-path/13501/13) says that `ENV["JULIA_HOME_DEPOT"]="/some/path"` should suffice.

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [February 7, 2019, 4:32am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/9 "2019-02-07T04:32:03Z")

</div>

The `.julia` folder is a “depot”. You can see/set the stack of depots with `DEPOT_PATH`. The default depot is usually at `/home/SomeUser/.julia`.

> [@xiaodai](#):
>
> I understand I can just put the code there and it will recognise it.

I’m not sure what you mean by this. Are you trying to do something special?

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [February 7, 2019, 4:35am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/10 "2019-02-07T04:35:31Z")

</div>

No. I just want to copy the files from a package and put them into `.julila`, so then `using PkgName` should work right?

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [February 7, 2019, 4:42am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/11 "2019-02-07T04:42:48Z")

</div>

You have to set your environment too. Its not really recommended to set those files manually unless you are forced to e.g. in an an offline environment.

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [February 7, 2019, 5:03am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/12 "2019-02-07T05:03:38Z")

</div>

Also, it would be better if you didn’t necropost across multiple `Pkg` threads. It just makes them more noisy for future Julia users who also need help.

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [February 7, 2019, 5:17am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/13 "2019-02-07T05:17:14Z")

</div>

> [@00vareladavid](#):
>
> Also, it would be better if you didn’t necropost across multiple `Pkg` threads. It just makes them more noisy for future Julia users who also need help.

I don’t agree with you at all. After reading this post I still couldn’t figure out how to do it. So posting and adding more info actually helps others who are in the same situation as me.

My posts were asking different things, and that’s why they were different postings to start with.

---

<div class="post-metadata">

**Author:** ![JesperMartinsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jespermartinsson/32/34098_2.png) [@JesperMartinsson](https://discourse.julialang.org/u/JesperMartinsson)\
**Post date:** [February 7, 2019, 6:38am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/14 "2019-02-07T06:38:38Z")

</div>

I personally find this link to Erik’s blog post very useful for working with off line packages: [https://medium.com/@Jernfrost/my-new-workflow-with-julia-1-0-99711103d97c](https://medium.com/@Jernfrost/my-new-workflow-with-julia-1-0-99711103d97c)

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [February 7, 2019, 7:51am UTC](https://discourse.julialang.org/t/offline-package-installation/7880/15 "2019-02-07T07:51:21Z")

</div>

@alea I suspect from what is said here that this system does have a connection to the internet, but it uses a proxy. We can help you set up the environment variables for the git program which allow you to download packages using the proxy.  
Please ask your systems guy if there is a proxy.

Also I would advise that your systems guy creates an account called something like ‘software’- then you can install Julia as the ‘software’ user and create a JULIA\_PKG directory which the software user can write to.

---

<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:** [March 7, 2020, 3:19pm UTC](https://discourse.julialang.org/t/offline-package-installation/7880/16 "2020-03-07T15:19:41Z")

</div>

let say, you are a teacher and there are many students in your class and you have already many packages installed and you don’t want that your students waste the school internet on re-downloading the packages.

---

<div class="post-metadata">

**Author:** ![ZikangXiong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zikangxiong/32/22949_2.png) [@ZikangXiong](https://discourse.julialang.org/u/ZikangXiong)\
**Post date:** [March 15, 2021, 10:56pm UTC](https://discourse.julialang.org/t/offline-package-installation/7880/17 "2021-03-15T22:56:40Z")

</div>

Basically, you still need a git repository, but you can install it locally. See [here](https://julialang.github.io/Pkg.jl/v1.1/managing-packages/#Adding-a-local-package-1).
