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:
- Open your shell profile configuration:
nano ~/.bashrc - Append the following export statement to the bottom of the file:
export PATH=$PATH:$(go env GOPATH)/bin - Save and exit (Ctrl + O, then Ctrl + X), then source your environment:
source ~/.bashrc - Type
lazygitto launch the terminal git manager interface.