Using cargo offline with apt packages
To instruct cargo to use only dependencies you've locally installed with apt instead of those on
crates.io, set up your
.cargo/config.toml file like this. For example, the one in your home directory
[net] offline = true [source] [source.apt] directory = "/usr/share/cargo/registry" [source.crates-io] replace-with = "apt"
See the blog post which prompted this: Rust without crates.io