# How can I create a linux distribution package for a julia package?

**URL:** <https://discourse.julialang.org/t/how-can-i-create-a-linux-distribution-package-for-a-julia-package/85656>\
**Category:** Package Management\
**Created:** [August 12, 2022, 7:44am UTC](https://discourse.julialang.org/t/how-can-i-create-a-linux-distribution-package-for-a-julia-package/85656 "2022-08-12T07:44:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amano](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@amano](https://discourse.julialang.org/u/amano)\
**Post date:** [August 12, 2022, 7:44am UTC](https://discourse.julialang.org/t/how-can-i-create-a-linux-distribution-package-for-a-julia-package/85656/1 "2022-08-12T07:44:19Z")

</div>

I barely know anything about julia, but I may want to learn julia if it’s possible for me to create linux distribution packages for julia packages.

It seems to involve `JULIA_DEPOT_PATH`. But, I don’t really know.

Is it possible to install a julia package locally in /usr/share/julia without downloading anything from the internet? My linux distribution downloads and installs dependencies and prevents language-specific build tools from downloading anything from the internet. This works for R and python.

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [August 12, 2022, 8:03am UTC](https://discourse.julialang.org/t/how-can-i-create-a-linux-distribution-package-for-a-julia-package/85656/2 "2022-08-12T08:03:54Z")

</div>

The easiest way to add a package from a location on disk is probably do do `pkg> dev /path/to/package`, though then you have to manually clone the repo with the package first. The only problem is that the package manager will try to install all dependencies of that package also.  
There is [Pkg.offline](https://pkgdocs.julialang.org/v1/api/#Pkg.offline) mode that tells Pkg to not download stuff that isn’t already present, though then you have to manually make sure all dependencies are present.  
You can maybe do this on another computer, and then copy over the depot directory, though if it is a different architecture any artifacts will be for that architecture and won’t work.

---

<div class="post-metadata">

**Author:** ![amano](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@amano](https://discourse.julialang.org/u/amano)\
**Post date:** [August 12, 2022, 10:38pm UTC](https://discourse.julialang.org/t/how-can-i-create-a-linux-distribution-package-for-a-julia-package/85656/3 "2022-08-12T22:38:54Z")

</div>

What if a julia module directory is not a git directory? Is `dev` command really suitable for preparing a linux distribution package?

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [August 13, 2022, 5:22am UTC](https://discourse.julialang.org/t/how-can-i-create-a-linux-distribution-package-for-a-julia-package/85656/4 "2022-08-13T05:22:53Z")

</div>

Maybe not. I mostly listed other alternatives since I don’t think there is any convenient way to do it through a linux package manager, and didn’t see the point of involving it.

But if you must do it you could probably set up the full depot path you need with all packages, and just package that up. After install you just need to set depot path and maybe offline mode. I think that should work.

---

<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:** [August 13, 2022, 6:29am UTC](https://discourse.julialang.org/t/how-can-i-create-a-linux-distribution-package-for-a-julia-package/85656/5 "2022-08-13T06:29:08Z")

</div>

If you re doing scientific computing look at Spack and Easybuild  
I think this is a good question and would love to see a discussion on here about shipping Julia packages via Spack/Easybuild

[https://spack.readthedocs.io/en/latest/](https://spack.readthedocs.io/en/latest/)

[https://easybuild.io/](https://easybuild.io/)

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [August 13, 2022, 1:12pm UTC](https://discourse.julialang.org/t/how-can-i-create-a-linux-distribution-package-for-a-julia-package/85656/6 "2022-08-13T13:12:44Z")

</div>

Do you need to handle platform-dependent artifacts, or binaries of any kind? Are you thinking of _binary_ distro packages (à la `.deb`), or _source_ packages (where you ship only source codes and the recipes needed to build anything platform-dependent on the target system, à la `.dsc`)?

> [@amano](#):
>
> Is it possible to install a julia package locally in /usr/share/julia without downloading anything from the internet?

I’m assuming it’s still possible for you to build/prepare the distro package itself on a machine that can access the Internet, i.e there is some machine somewhere, that you can access and where `Pkg.add` will work. Is that true? Can we assume that this machine has the same architecture than your target system?

---

<div class="post-metadata">

**Author:** ![amano](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@amano](https://discourse.julialang.org/u/amano)\
**Post date:** [August 13, 2022, 1:19pm UTC](https://discourse.julialang.org/t/how-can-i-create-a-linux-distribution-package-for-a-julia-package/85656/7 "2022-08-13T13:19:52Z")

</div>

I ship source packages.

Gentoo Linux blocks internet access during package build for reproducibility. Gentoo downloads and installs dependencies. It’s possible to allow exceptions, but I don’t want to do that.

Gentoo Linux builds nearly all packages.

The machine that builds packages is the target machine usually. But, binary packages can be distributed to computers that use the same CPU architecture.
