Needing internet to run cargo install

I'm using cargo to build my programs is great when I have internet. But even after downloading all the requirements. I still need internet access to run install.

If I run install with internet. It works, but then if I lose internet access, and run install again. It has to redownload dependencies from

Why is that?

This is better asked on you can use the --offline flag to use already built crates


Have you tried using --locked --offline? It's likely redownloading dependencies because without --locked it will re-resolve the dependency tree and come up with different versions (see Without --offline it will attempt to at least update the index before building.

1 Like

cargo install probably isn't what you want. cargo install is for installing binaries from crates-io. You probably want cargo build.

cargo install path can operate offline, as it installs from the given path. cargo install can't, as it installs from crates-io, which is online.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.