Skip to content

Instantly share code, notes, and snippets.

@ferdinandkeller
Last active April 15, 2024 15:48
Show Gist options
  • Save ferdinandkeller/26d23e6fec8ec2e80663fa2a327492ee to your computer and use it in GitHub Desktop.
Save ferdinandkeller/26d23e6fec8ec2e80663fa2a327492ee 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
@ferdinandkeller
Copy link
Author

ferdinandkeller commented Apr 15, 2024

Install command (needs sudo, curl and bash preinstalled):

bash <(curl --proto '=https' --tlsv1.2 -sSfL https://gist.github.com/ferdinandkeller/26d23e6fec8ec2e80663fa2a327492ee/raw)

@ferdinandkeller
Copy link
Author

The script is derived from the official try script, but with the added install functionality, so that you can reuse it multiple times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment