Skip to content

Instantly share code, notes, and snippets.

@peteristhegreat
Last active September 8, 2025 16:16
Show Gist options
  • Select an option

  • Save peteristhegreat/add18f6c4d72b91670b89c2d19dce4e3 to your computer and use it in GitHub Desktop.

Select an option

Save peteristhegreat/add18f6c4d72b91670b89c2d19dce4e3 to your computer and use it in GitHub Desktop.
LazyGit for Rpi
#!/usr/bin/env bash
set -x
# Update system
sudo apt update && sudo apt upgrade -y
# Install dependencies
sudo apt install -y git curl build-essential
# Install Go (latest stable from golang.org)
GO_VERSION=$(curl -s 'https://go.dev/VERSION?m=text' | head -n 1)
wget https://go.dev/dl/${GO_VERSION}.linux-arm64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf ${GO_VERSION}.linux-arm64.tar.gz
echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
# Verify Go
go version
# Build and install lazygit
git clone https://github.com/jesseduffield/lazygit.git
cd lazygit
go install -v
# Add Go bin to PATH if not already
echo "export PATH=\$PATH:$(go env GOPATH)/bin" >> ~/.bashrc
source ~/.bashrc
# Verify
lazygit --version

/usr/local/bin/lazygit: cannot execute binary file: Exec format error

Install from Bookworm Debian repo? See if Rpi got more support on the github page again?

Directions

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/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit -D -t /usr/local/bin/

Results when running:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 7742k  100 7742k    0     0  3528k      0  0:00:02  0:00:02 --:--:-- 9056k
$ which lazygit
/usr/local/bin/lazygit
$ lazygit
-bash: /usr/local/bin/lazygit: cannot execute binary file: Exec format error

Install from a Snap?

https://snapcraft.io/install/lazygit-gm/raspbian

$ sudo snap install lazygit-gm
lazygit-gm 0.31.4-16-gd5c1cfda from Graham Morrison (degville) installed
$ lazygit
-bash: lazygit: command not found
$ lazygit-gm
/snap/lazygit-gm/1/snap/command-chain/snapcraft-runner: 5: exec: /snap/lazygit-gm/1/bin/lazygit: Exec format error

Install by building from Go

See script install-lg-rpi-x64.sh on this page.

It worked!

~/src/lazygit $ lazygit -v
commit=0d5a410114036e2151087e6a8cf5295cca317c16, build date=2025-09-06T07:11:27Z, build source=unknown, version=0d5a4101, os=linux, arch=arm64, git version=2.39.5
 $ which lazygit
/home/phyatt/go/bin/lazygit
~/go/bin $ ls -lh
total 29M
-rwxr-xr-x 1 user user 29M Sep  8 11:58 lazygit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment