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

The zoxide utility is a smarter, lightning-fast cd command alternative written in Rust that remembers which directories you use most frequently, allowing you to jump across deeply nested project trees with simple fuzzy keywords (e.g. z project). In freshly deployed minimal Linux installations, container base images, or remote VPS servers, running zoxide or attempting to use its navigation alias z returns bash: zoxide: command not found because the utility is not pre-installed in default distributions.

Install zoxide via Official Standalone Shell Script

The recommended installation method for minimal systems fetches the pre-compiled static binary directly without requiring package manager repositories:

# Download and install zoxide into ~/.local/bin
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh

# Move binary to global system path if required for all users
sudo mv ~/.local/bin/zoxide /usr/local/bin/

# Ensure executable execution permissions
sudo chmod +x /usr/local/bin/zoxide

# Verify installation
zoxide --version

Initialize Shell Hook in Bash Profile

Installing the binary alone does not create the z navigation alias; explicit shell integration is mandatory:

  1. Append the shell initialization hook to your user configuration:
    echo 'eval "$(zoxide init bash)"' >> ~/.bashrc
    source ~/.bashrc
  2. For Zsh users, append eval "$(zoxide init zsh)" to ~/.zshrc instead.
  3. For Fish users, add zoxide init fish | source to ~/.config/fish/config.fish.
  4. Test directory navigation by switching folders using z.

Install via Linux Distribution Repositories

Modern Linux package registries also include zoxide natively:

# On Debian or Ubuntu (22.04+):
sudo apt update && sudo apt install -y zoxide

# On Arch Linux:
sudo pacman -S zoxide

# On Alpine Linux:
apk add zoxide

# On systems with Homebrew:
brew install zoxide

Get the best tech tips delivered straight to your inbox.

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