Skip to content

Instantly share code, notes, and snippets.

@AskinNet
Forked from ferdinandkeller/install_zellij.sh
Created February 5, 2025 05:23
Show Gist options
  • Save AskinNet/bd714645a9922611be5cc9075b310878 to your computer and use it in GitHub Desktop.
Save AskinNet/bd714645a9922611be5cc9075b310878 to your computer and use it in GitHub Desktop.
Script to install Zellij on Debian/Ubuntu without snap packages.
#!/usr/bin/env bash
# derived from official installation script: https://zellij.dev/launch
dir="/usr/local/bin"
if [[ -x "$dir/zellij" ]]
then
"$dir/zellij" "$@"
exit
fi
case $(uname -m) in
"x86_64"|"aarch64")
arch=$(uname -m)
;;
"arm64")
arch="aarch64"
;;
*)
echo "Unsupported cpu arch: $(uname -m)"
exit 2
;;
esac
case $(uname -s) in
"Linux")
sys="unknown-linux-musl"
;;
"Darwin")
sys="apple-darwin"
;;
*)
echo "Unsupported system: $(uname -s)"
exit 2
;;
esac
url="https://github.com/zellij-org/zellij/releases/latest/download/zellij-$arch-$sys.tar.gz"
sudo bash -c "curl --location $url | tar -C $dir -xz"
if [[ $? -ne 0 ]]
then
echo
echo "Extracting binary failed, cannot launch zellij :("
echo "One probable cause is that a new release just happened and the binary is currently building."
echo "Maybe try again later? :)"
exit 1
fi
"$dir/zellij" "$@"
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment