table of contents
CARGO-UPDATE(1) | General Commands Manual | CARGO-UPDATE(1) |
NAME¶
cargo-update — Update dependencies as recorded in the local lock file
SYNOPSIS¶
cargo update [options] spec
DESCRIPTION¶
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.
OPTIONS¶
Update Options¶
spec…
If packages are specified with spec, 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 spec is not specified, all dependencies are updated.
--recursive
--precise precise
While not recommended, you can specify a yanked version of a package (nightly only). When possible, try other non-yanked SemVer-compatible versions or seek help from the maintainers of the package.
-w, --workspace
--dry-run
Display Options¶
-v, --verbose
-q, --quiet
--color when
May also be specified with the term.color config value <https://doc.rust-lang.org/cargo/reference/config.html>.
Manifest Options¶
--manifest-path path
--frozen, --locked
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.
--offline
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>.
Common Options¶
+toolchain
--config KEY=VALUE or PATH
-C PATH
This option is only available on the nightly channel <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and requires the -Z unstable-options flag to enable (see #10098 <https://github.com/rust-lang/cargo/issues/10098>).
-h, --help
-Z flag
ENVIRONMENT¶
See the reference <https://doc.rust-lang.org/cargo/reference/environment-variables.html> for details on environment variables that Cargo reads.
EXIT STATUS¶
EXAMPLES¶
cargo update
cargo update foo bar
cargo update foo --precise 1.2.3