Offline installation of Julia packages




I need to install a bunch of packages on an offline computer ( it must be disconnected ).

I didn’t found any guide that provide a clean way for installing packages offline and maybe someone could help me with that.

I tried this :

  1. For each packages, download its github repo ( not with git clone ) and store it somewhere at local/path/pkg_n
  2. Add the local/path/pkg_n to these packages via Pkg

But when adding these local path, Pkg return this :

(v1.1) pkg> add local\path\pkg_1
Updating registry at ~\.julia\registries\General
Updating git-repo
Cloning git-repo local\path\pkg_1\
ERROR: Git repository not found at ‘local\path\pkg_1’

So the local path must be a git repo.

Then I tried with dev since it will create automatically a repo and update julia environnement Manifest.toml and Project.toml files.

For packages with a lot of dependencies, I could do this on all the packages in the dependency graph that are not already installed on hope for the best, but I haven’t tried yet.

Does anyone have any idea on how to do this properly ?

Thank you in advance !


I think currently there is no way of doing that, see

However, I think you can try installing in another computer, and then copy the ~/.julia directory to the offline computer. Sometimes it gives problem by differences in the systems, but it is the simpler way. I suggest you to test it.


Well with this solution the problem is that I can only use packages built on a windows OS, and since the offline computer is using debian I think it is going to be tricky .

I might get around that by using Pkg.develop and configuring myself the dependency like I would do for a private package.

It is going to be cumbersome but I guess I don’t have another choice.


Use a docker container.


@gdestouet You might look at Julia Team


Thank you for your response.
So if ever want to add or upgrade a package, I will have to build a docker image and reinstall it ? It seems a bit cumbersome at the beginning but I will give it a try.


Did you do this using ‘git clone’ ? Please give us an example of the package you wish to install and the command you used to create the clone. Thanks!


You can automate it. Also, offline environments are already cumbersome, the best you can do is to come up with a workflow that mitigates this to some extent.


For a simple test I tried with Unitful.jl, I wasn’t using git clone for this but only the decompressed archive.

With git clone it works well when using Pkg.add, I am going to do this for any packages I need.

I will do this with a package with many dependencies and come back with what I did.


Unfortunately I can’t use Docker Images and I would prefer to build packages on the offline machine, so here is what I did :

Let say that I have a project on a computer connected to internet that I want to export and install on an offline computer along with its dependencies ( outside Julia’s stdlib ).

For this project I have the canonical structure :

│   Manifest.toml
│   Project.toml

I make sure that all dependencies of Project_Test are installed and present in Manifest.toml and that it is running properly. And that both computers have the same project with the same dependencies.

Instead of copying all the packages from the default depot path (.julia/packages/...) to julia depot path on the offline computer. The following function ( a flattened and pruned version of Pkg.Types.add_or_develop and Pkg.Operates.add_or_develop combined ) will download all the packages needed and store it on the external_device at path_to_external . It will keep the structure used in the default depot path ( version-dependent ).It will also copy the registry to avoid Pkg.Types.manifest_info to call for a remote clone of the default registry while installing packages on the offline computer.

import Pkg.Types: PackageSpec,GitRepo,Context,project_deps_resolve!,registry_resolve!,stdlib_resolve!,ensure_resolved,manifest_info,write_env,update_registries,pkgerror,printpkgstyle
import Pkg.activate
import Pkg.Operations:resolve_versions!,version_data!,install_archive
import Pkg.BinaryProvider
using UUIDs
import LibGit2

function export_packages(path_to_project,path_to_external)
    project = ctx.env.project

    pkgs = [ PackageSpec(k,v) for (k,v) in project.deps ]

    for pkg in pkgs
        ctx.env.project.deps[] = pkg.uuid

    for (name::String, uuid::UUID) in ctx.env.project.deps
        entry = manifest_info(ctx.env, uuid)
        entry !== nothing && entry.version !== nothing || continue
        version = VersionNumber(entry.version)
        for pkg in pkgs
            pkg.uuid == uuid && version ∈ pkg.version || continue
            pkg.version = version

    resolve_versions!(ctx, pkgs)
    hashes, urls = version_data!(ctx, pkgs)

    for pkg in pkgs
        pkg.uuid in keys(ctx.stdlibs) && continue
        pkg.repo = GitRepo(urls[pkg.uuid][1],nothing,nothing)

    pkgs_to_install = Tuple{PackageSpec, String}[]
    for pkg in pkgs
        pkg.uuid in keys(ctx.stdlibs) && continue
        path = joinpath(path_to_external,,Base.version_slug(pkg.uuid,hashes[pkg.uuid]))
        push!(pkgs_to_install, (pkg, path))

    widths = [textwidth( for (pkg, _) in pkgs_to_install]
    max_name = length(widths) == 0 ? 0 : maximum(widths)

    results = Channel(length(pkgs));
    for (pkg, path) in pkgs_to_install
        print("$i over $(length(pkgs_to_install)) downloaded packages\r")
            success = install_archive(urls[pkg.uuid], hashes[pkg.uuid], path)
            if ctx.use_only_tarballs_for_downloads && !success
                pkgerror("failed to get tarball from $(urls[pkg.uuid])")
            put!(results, (pkg, success, path))
        catch err
            put!(results, (pkg, err, catch_backtrace()))

    missed_packages = Tuple{PackageSpec, String}[]
    for i in 1:length(pkgs_to_install)
        pkg, exc_or_success, bt_or_path = take!(results)
        exc_or_success isa Exception && pkgerror("Error when installing package $(\n",
                                                 sprint(Base.showerror, exc_or_success, bt_or_path))
        success, path = exc_or_success, bt_or_path
        if success
            vstr = pkg.version != nothing ? "v$(pkg.version)" : "[$h]"
            printpkgstyle(ctx, :Installed, string(rpad( * " ", max_name + 2, "─"), " ", vstr))
            push!(missed_packages, (pkg, path))

    for (pkg, path) in missed_packages
        uuid = pkg.uuid
        if !ctx.preview
            install_git(ctx, pkg.uuid,, hashes[uuid], urls[uuid], pkg.version::VersionNumber, path)
        vstr = pkg.version != nothing ? "v$(pkg.version)" : "[$h]"
        @info "Installed $(rpad( * " ", max_name + 2, "─")) $vstr"


Once the packages are stored on the external device. I used the following script to install and build them on the offline computer.

import Pkg:activate,depots1
import Pkg.Types:Context
import Pkg.Operations:build_versions

function add_local_packagesv11(pkgs_path,project_path)
    registry_path = joinpath(depots1(),"registries")
    for file in files
        if isdir(path)

project_path = "/path/to/Project_Test"
pkgs_path= "/path/to/external_device/pkgs"

Works well if the packages used doesn’t require internet to build, in which case you will have to configure the deps/build.jl scripts.
For example, if I want to build DSP on the offline computer I will have to modify its build.jl and download the specific FFTW library it needs.
Whereas, Conda builds well offline.

Tested with a project with ~40 dependencies on Julia 1.1.0.