Offline Development on an Air Gapped Machine

It’s the same thing Sukera already mentioned, one can choose the Julia depot to be located somewhere else than $HOME/.julia.

No, just do Pkg.add() as before, then copy the Julia depot. I think you also may want to prevent/interrupt the precompilation, to prevent wasted work in case the CPU is not the same on both machines. Here’s an example:

[nsajko@aceramd bin]$ JULIA_DEPOT_PATH=/home/nsajko/tmp/jl_depot ./julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.0-beta3 (2023-10-03)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.10) pkg> st
  Installing known registries into `~/tmp/jl_depot`
Status `~/tmp/jl_depot/environments/v1.10/Project.toml` (empty project)

(@v1.10) pkg> up
    Updating registry at `~/tmp/jl_depot/registries/General.toml`
  No Changes to `~/tmp/jl_depot/environments/v1.10/Project.toml`
  No Changes to `~/tmp/jl_depot/environments/v1.10/Manifest.toml`
[ Info: We haven't cleaned this depot up for a bit, running Pkg.gc()...
      Active manifest files: 1 found
      Active artifact files: 0 found
      Active scratchspaces: 0 found
     Deleted no artifacts, repos, packages or scratchspaces

(@v1.10) pkg> add MutableArithmetics
   Resolving package versions...
   Installed MutableArithmetics ─ v1.3.3
    Updating `~/tmp/jl_depot/environments/v1.10/Project.toml`
  [d8a4904e] + MutableArithmetics v1.3.3
    Updating `~/tmp/jl_depot/environments/v1.10/Manifest.toml`
  [d8a4904e] + MutableArithmetics v1.3.3
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL v0.6.4
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.10.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays v1.10.0
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.0.5+1
  [deac9b47] + LibCURL_jll v8.0.1+1
  [e37daf67] + LibGit2_jll v1.6.4+0
  [29816b5a] + LibSSH2_jll v1.11.0+1
  [c8ffd9c3] + MbedTLS_jll v2.28.2+1
  [14a3606d] + MozillaCACerts_jll v2023.1.10
  [4536629a] + OpenBLAS_jll v0.3.23+2
  [bea87d4a] + SuiteSparse_jll v7.2.0+1
  [83775a58] + Zlib_jll v1.2.13+1
  [8e850b90] + libblastrampoline_jll v5.8.0+1
  [8e850ede] + nghttp2_jll v1.52.0+1
  [3f19e933] + p7zip_jll v17.4.0+2
Precompiling project...
  6 dependencies successfully precompiled in 9 seconds

(@v1.10) pkg> gc --all
      Active manifest files: 1 found
      Active artifact files: 0 found
      Active scratchspaces: 0 found
     Deleted no artifacts, repos, packages or scratchspaces

julia> 
[nsajko@aceramd bin]$ bash
[nsajko@aceramd bin]$ cd /home/nsajko/tmp/jl
jl/       jl_depot/ 
[nsajko@aceramd bin]$ cd /home/nsajko/tmp/jl
jl/       jl_depot/ 
[nsajko@aceramd bin]$ cd /home/nsajko/tmp/jl_depot/
[nsajko@aceramd jl_depot]$ ls -l
total 0
drwxr-xr-x 1 nsajko nsajko 10 Oct 15 12:40 compiled
drwxr-xr-x 1 nsajko nsajko 10 Oct 15 12:39 environments
drwxr-xr-x 1 nsajko nsajko 94 Oct 15 12:41 logs
drwxr-xr-x 1 nsajko nsajko 36 Oct 15 12:40 packages
drwxr-xr-x 1 nsajko nsajko 52 Oct 15 12:39 registries
drwxr-xr-x 1 nsajko nsajko 72 Oct 15 12:39 scratchspaces
[nsajko@aceramd jl_depot]$ ls -l compiled/
total 0
drwxr-xr-x 1 nsajko nsajko 170 Oct 15 12:40 v1.10
[nsajko@aceramd jl_depot]$ rm -r compiled/  # save CD space
[nsajko@aceramd jl_depot]$ exit
exit
[nsajko@aceramd bin]$ # Now you would copy /home/nsajko/tmp/jl_depot to CDs
[nsajko@aceramd bin]$ # and carry on on the air-gapped machine.
[nsajko@aceramd bin]$ JULIA_DEPOT_PATH=/home/nsajko/tmp/jl_depot JULIA_PKG_OFFLINE=true ./julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.0-beta3 (2023-10-03)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.10) [offline] pkg> st
Status `~/tmp/jl_depot/environments/v1.10/Project.toml`
  [d8a4904e] MutableArithmetics v1.3.3
2 Likes