1CARGO-UPDATE(1) CARGO-UPDATE(1)
2
3
4
6 cargo-update - Update dependencies as recorded in the local lock file
7
9 cargo update [OPTIONS]
10
12 This command will update dependencies in the Cargo.lock file to the
13 latest version. It requires that the Cargo.lock file already exists as
14 generated by commands such as cargo-build(1) or
15 cargo-generate-lockfile(1).
16
18 Update Options
19 -p SPEC..., --package SPEC...
20 Update only the specified packages. This flag may be specified
21 multiple times. See cargo-pkgid(1) for the SPEC format.
22
23 If packages are specified with the -p flag, then a conservative
24 update of the lockfile will be performed. This means that only the
25 dependency specified by SPEC will be updated. Its transitive
26 dependencies will be updated only if SPEC cannot be updated without
27 updating dependencies. All other dependencies will remain locked at
28 their currently recorded versions.
29
30 If -p is not specified, all dependencies are updated.
31
32 --aggressive
33 When used with -p, dependencies of SPEC are forced to update as
34 well. Cannot be used with --precise.
35
36 --precise PRECISE
37 When used with -p, allows you to specify a specific version number
38 to set the package to. If the package comes from a git repository,
39 this can be a git revision (such as a SHA hash or tag).
40
41 --dry-run
42 Displays what would be updated, but doesn’t actually write the
43 lockfile.
44
45 Display Options
46 -v, --verbose
47 Use verbose output. May be specified twice for "very verbose"
48 output which includes extra output such as dependency warnings and
49 build script output. May also be specified with the term.verbose
50 config value
51 <https://doc.rust-lang.org/cargo/reference/config.html>.
52
53 -q, --quiet
54 No output printed to stdout.
55
56 --color WHEN
57 Control when colored output is used. Valid values:
58
59 · auto (default): Automatically detect if color support is
60 available on the terminal.
61
62 · always: Always display colors.
63
64 · never: Never display colors.
65
66 May also be specified with the term.color config value
67 <https://doc.rust-lang.org/cargo/reference/config.html>.
68
69 Manifest Options
70 --manifest-path PATH
71 Path to the Cargo.toml file. By default, Cargo searches in the
72 current directory or any parent directory for the Cargo.toml file.
73
74 --frozen, --locked
75 Either of these flags requires that the Cargo.lock file is
76 up-to-date. If the lock file is missing, or it needs to be updated,
77 Cargo will exit with an error. The --frozen flag also prevents
78 Cargo from attempting to access the network to determine if it is
79 out-of-date.
80
81 These may be used in environments where you want to assert that the
82 Cargo.lock file is up-to-date (such as a CI build) or want to avoid
83 network access.
84
85 Common Options
86 -h, --help
87 Prints help information.
88
89 -Z FLAG...
90 Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
91 details.
92
94 See the reference
95 <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
96 for details on environment variables that Cargo reads.
97
99 0
100 Cargo succeeded.
101
102 101
103 Cargo failed to complete.
104
106 1. Update all dependencies in the lockfile:
107
108 cargo update
109
110 2. Update only specific dependencies:
111
112 cargo update -p foo -p bar
113
114 3. Set a specific dependency to a specific version:
115
116 cargo update -p foo --precise 1.2.3
117
119 cargo(1), cargo-generate-lockfile(1)
120
121
122
123 2018-12-23 CARGO-UPDATE(1)