today 26.02.2026
category
Category

Gentoo: fix “no such command: `fmt`” error

If you installed Rust on Gentoo without any additional steps and run cargo fmt in your project folder, you propably encounter the following error:

error: no such command: `fmt`

help: a command with a similar name exists: `fix`

help: view all installed commands with `cargo --list`
help: find a package to install `fmt` with `cargo search cargo-fmt`

This is most likely a very Gentoo problem, and an easy fix: simply add the rustfmt USE flag to your Rust package and rebuild Rust.

local_offer Tag Linux, Gentoo, Software, How-to