LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

cargo-generate-lockfile

Create or regenerate Cargo.lock for a Rust project

TLDR

Generate lock file
$ cargo generate-lockfile
copy
Regenerate with latest versions
$ cargo generate-lockfile
copy
Generate with specific manifest
$ cargo generate-lockfile --manifest-path [path/to/Cargo.toml]
copy
Generate with custom lockfile path
$ cargo generate-lockfile --lockfile-path [/tmp/Cargo.lock]
copy

SYNOPSIS

cargo generate-lockfile [options]

DESCRIPTION

cargo generate-lockfile creates or rebuilds Cargo.lock for the current package or workspace. If lockfile exists, rebuilds with latest available versions of all packages.

PARAMETERS

--manifest-path path

Path to Cargo.toml
--lockfile-path path
Custom lockfile path (must end with Cargo.lock)
--locked
Assert exact same dependencies as original lockfile
--offline
Don't access network
--frozen
Equivalent to --locked and --offline
-v, --verbose
Verbose output (use twice for very verbose)
-q, --quiet
Suppress log messages

BEHAVIOR

Creates new Cargo.lock if none exists. Rebuilds existing lockfile with newest compatible versions. Use cargo update for more control over version updates.

INSTALL

sudo apt install cargo
copy
sudo dnf install cargo
copy
sudo apk add cargo
copy
sudo zypper install cargo
copy
nix profile install nixpkgs#cargo
copy

CAVEATS

Ensures reproducible builds by locking dependency versions. Useful in CI pipelines for deterministic builds. Consider committing Cargo.lock for applications, not libraries.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid