cargo Verified current stable Not installed? Build Tools

Cargo / Update Sui From Source

Update Sui From Source

Easily update the SUI package from the latest source on GitHub using Cargo.

$
Terminal
cargo install --locked --git https://github.com/MystenLabs/sui.git --branch testnet sui

When To Use

Updating your SUI installation to the latest version from the testnet branch.

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
Updating crates...
   Compiling sui v0.1.0 (https://github.com/MystenLabs/sui.git?branch=testnet)
    Finished dev [unoptimized + debuginfo] target(s) in 1.23s

Installed package 'sui' from source.

Power User Variants

Optimized versions

cargo install --git https://github.com/MystenLabs/sui.git sui

Install SUI from the latest commit on the default branch.

cargo install --git https://github.com/MystenLabs/sui.git --branch main sui

Install SUI from the main branch of the repository.

Troubleshooting

Common pitfalls

Failed to clone repository

Solution: Check the repository URL and your internet connection.

Permission denied

Solution: Ensure you have the necessary permissions to install packages.

Command Breakdown

What each part is doing

cargo
Base Command
The executable that performs this operation. Here it runs Cargo before the shell applies any redirect operators.
--locked
Command Option
Tool-specific option used by this command invocation.
--git
Command Option
Tool-specific option used by this command invocation.
--branch
Command Option
Tool-specific option used by this command invocation.

How To Run

Execution path

  1. Step 1

    Open your terminal.

  2. Step 2

    Run the command: cargo install --locked --git https://github.com/MystenLabs/sui.git --branch testnet sui.

  3. Step 3

    Verify the installation by checking the version of SUI.

Alternative Approaches

Comparable commands in other tools

Alternative build tools tools for the same job.