Debian GNU/Linux 12 (bookworm) aarch64
https://github.com/jesseduffield/lazygit?tab=readme-ov-file#ubuntu
#!/bin/bash
DOWNLOAD_DIR=~/downloads
LATEST_TAG=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | jq -r '.tag_name')
LATEST_VERSION=${LATEST_TAG//v/}
KERNEL_NAME=$(uname -s)
ARCHITECTURE=$(dpkg --print-architecture)
# version check
if version_info=$(lazygit --version); then
cur_version=$(echo "$version_info" | grep -oP 'version=\K[0-9]+(\.[0-9]+){2}' | head -1)
if ! dpkg --compare-versions "${LATEST_VERSION}" "gt" "$cur_version"; then
echo "lazygit is already the newest version ($cur_version)"
exit 0
fi
fi
mkdir -p "$DOWNLOAD_DIR"
cd "$DOWNLOAD_DIR" || exit 1
asset_name="lazygit_${LATEST_VERSION}_${KERNEL_NAME}_${ARCHITECTURE}.tar.gz"
echo "Asset name: $asset_name"
curl -Lo lazygit.tar.gz \
"https://github.com/jesseduffield/lazygit/releases/download/$LATEST_TAG/$asset_name"
tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
rm lazygit.tar.gz lazygit
- check and set
DOWNLOAD_DIR
- check
asset_name
jq
required
lazygit --version