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

Developers working in minimal server installations, lightweight cloud instances, and headless developer containers rely on lazygit, a terminal-based user interface for Git commands that streamlines branch management, rebasing, and diff inspections. Because lazygit is written in Go and maintained as a standalone utility, minimal distributions like Ubuntu Server, Debian Minimal, and Alpine do not include it in standard base package groups, resulting in the immediate shell error: bash: lazygit: command not found.

Install lazygit via Distribution Package Repositories

Modern Linux package managers provide simple repository installation channels:

Ubuntu and Debian

# Download official release binary from GitHub releases
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
lazygit --version

Alpine Linux

# Enable community repository in /etc/apk/repositories
sudo apk update
sudo apk add lazygit

Fedora and RHEL / CentOS

sudo dnf copr enable atim/lazygit -y
sudo dnf install lazygit -y

Arch Linux

sudo pacman -S lazygit

Verify PATH Environment Variable for Local Go Installs

If you compiled or installed lazygit via go install github.com/jesseduffield/lazygit@latest, ensure your user Go binary directory is included in your active shell PATH:

  1. Open your shell profile configuration:
    nano ~/.bashrc
  2. Append the following export statement to the bottom of the file:
    export PATH=$PATH:$(go env GOPATH)/bin
  3. Save and exit (Ctrl + O, then Ctrl + X), then source your environment:
    source ~/.bashrc
  4. Type lazygit to launch the terminal git manager interface.

Get the best tech tips delivered straight to your inbox.

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