How to Fix bash: dua: command not found in Minimal Linux Distributions

The dua (Disk Usage Analyzer) utility is a modern, high-performance terminal tool written in Rust designed to calculate and display directory disk usage quickly while offering an interactive terminal user interface (TUI). When running dua or dua i in newly provisioned minimal Linux installations, Docker containers, or cloud VPS instances, bash responds with bash: dua: command not found because the utility is not part of standard GNU core utilities.

Install dua via Pre-Compiled Static Release Binary

For containerized environments or distributions without modern Rust packages, downloading the standalone pre-built binary is the simplest installation method:

# Download latest dua release archive for Linux x86_64
curl -sSL https://github.com/Byron/dua-cli/releases/latest/download/dua-v2.29.0-x86_64-unknown-linux-musl.tar.gz -o /tmp/dua.tar.gz

# Extract binary into system bin
sudo tar -xzf /tmp/dua.tar.gz -C /usr/local/bin/ --strip-components=1

# Ensure executable permissions are set
sudo chmod +x /usr/local/bin/dua

# Clean up archive
rm -f /tmp/dua.tar.gz

# Verify installation
dua --version

Install via Linux Distribution Package Managers

Major modern Linux distributions include dua-cli in their package registries:

# On Arch Linux:
sudo pacman -S dua-cli

# On Alpine Linux (Community):
apk add dua-cli

# On systems with Homebrew:
brew install dua-cli

Compile and Install via Cargo

If you have Rust and Cargo installed in your developer environment:

# Compile and install dua-cli to ~/.cargo/bin
cargo install dua-cli

# Ensure ~/.cargo/bin is present in your shell PATH
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Launch Interactive Disk Usage Inspection

Once installed, launch the interactive visual explorer by running dua i from your target root or storage directory.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.