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. When possible, try other non-yanked SemVer-compatible versions or seek help from the maintainers of the package.
A compatible pre-release version can also be specified even when the version requirement in Cargo.toml doesn’t contain any pre-release identifier (nightly only).
--breaking directory
Version requirements will be modified to allow this update.
This only applies to dependencies when
This option is unstable and available only 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 https://github.com/rust-lang/cargo/issues/12425 for more information.
-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
--ignore-rust-version
--locked
It may be used in environments where deterministic builds are desired, such as in CI pipelines.
--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.
--frozen
--lockfile-path 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 #14421 https://github.com/rust-lang/cargo/issues/14421).
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