Skip to main content
Update the pixi.lock file without installing the environment.

Usage

Description

The pixi lock command updates the lockfile (pixi.lock) based on your manifest (pixi.toml or pyproject.toml) without installing packages into environments. This is useful when you want to:
  • Update package versions in the lock file
  • Verify that dependencies can be resolved
  • Prepare for installation on another machine
  • Run in CI to check for dependency conflicts

Options

string
Update lock file for specific environment(s). Can be specified multiple times.
string
Update lock file for specific platform(s). Can be specified multiple times.
boolean
Don’t install the environment after updating the lock file (deprecated, this is now the default behavior).

Examples

Update Lock File for All Environments

This updates the lock file for all environments and platforms defined in your manifest.

Update Specific Environment

Only update the lock file for the production environment.

Update Multiple Platforms

Update the lock file for Linux and macOS ARM platforms only.

Check if Lock File is Up to Date

If the command succeeds without changes, your lock file is up to date with your manifest.

Lock File Behavior

The lock file (pixi.lock) contains:
  • Exact package versions for all dependencies
  • Package URLs and checksums
  • Platform-specific package selections
  • Dependency graph for each environment
The lock file should be committed to version control to ensure reproducible builds across different machines and CI environments.

Common Use Cases

CI/CD Pipeline

This ensures the lock file in your repository is up to date.

Before Installing on Another Machine

The --frozen flag with pixi install ensures it uses the exact versions from the lock file.

After Changing Dependencies

Update the lock file after adding new dependencies to ensure all platforms are resolved.