Create a lockfile without building.

Section: Inspection and troubleshooting

Generate or refresh Cargo.lock

bash
bash
cargo generate-lockfile
Explanation

Useful in automation or before commits when a lockfile is required.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Inspection and troubleshooting
Update dependency lockfile
Refresh locked dependency versions.
OpenIn sheetbashsame section
Show the dependency tree
Inspect the dependency graph for the package.
OpenIn sheetbashsame section
See reverse dependencies
Show what depends on a specific crate.
OpenIn sheetbashsame section
Inspect feature activation
Show the tree with features included.
OpenIn sheetbashsame section
Create project-local Cargo config
Store configuration in the project under `.cargo/config.toml`.
OpenIn sheettoml1 tag match
Enable Cargo debug logging
Emit tracing logs from Cargo itself.
OpenIn sheetbash1 tag match