table of contents
|CARGO-UPDATE(1)||General Commands Manual||CARGO-UPDATE(1)|
cargo-update - Update dependencies as recorded in the local lock file
cargo update [options]
This command will update dependencies in the Cargo.lock file to the latest version. If the Cargo.lock file does not exist, it will be created with the latest available versions.
-p spec..., --package spec...
If packages are specified with the -p flag, then a conservative update of the lockfile will be performed. This means that only the dependency specified by SPEC will be updated. Its transitive dependencies will be updated only if SPEC cannot be updated without updating dependencies. All other dependencies will remain locked at their currently recorded versions.
If -p is not specified, all dependencies are updated.
May also be specified with the term.color config value <https://doc.rust-lang.org/cargo/reference/config.html>.
These may be used in environments where you want to assert that the Cargo.lock file is up-to-date (such as a CI build) or want to avoid network access.
Beware that this may result in different dependency resolution than online mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.
May also be specified with the net.offline config value <https://doc.rust-lang.org/cargo/reference/config.html>.
See the reference <https://doc.rust-lang.org/cargo/reference/environment-variables.html> for details on environment variables that Cargo reads.
cargo update -p foo -p bar
cargo update -p foo --precise 1.2.3