Skip to content

Instantly share code, notes, and snippets.

@curtis628
Forked from AFRUITPIE/fish-build-install.sh
Last active November 19, 2023 18:02
Show Gist options
  • Save curtis628/07353525ad60234d03520ace3cf64c4e to your computer and use it in GitHub Desktop.
Save curtis628/07353525ad60234d03520ace3cf64c4e to your computer and use it in GitHub Desktop.
Install Fish Shell 3+ on Raspberry Pi
#!/bin/bash
# This helps install the latest fishshell on a Raspberry Pi, and was heavily influenced from
# https://gist.github.com/AFRUITPIE/1d26d3d15dc43f821a36d7ccc1260a7f
#
# NOTE: Along with "make"-related dependencies, it also installs 'jq'
#
# Use at your own risk as I have made no effort to make this install safe!
set -e
# Create and change into a build directory
BUILD_DIR=/tmp/fish-install
mkdir $BUILD_DIR && pushd $BUILD_DIR
# Install dependencies plus 'jq'
sudo apt-get install -y build-essential cmake ncurses-dev libncurses5-dev libpcre2-dev gettext jq
# Download and extract the latest build
LATEST_DOWNLOAD_URL=$(curl https://api.github.com/repos/fish-shell/fish-shell/releases/latest | \
jq --raw-output '.assets[] | select(.content_type == "application/x-xz").browser_download_url')
wget $LATEST_DOWNLOAD_URL
tar -xvf fish-*.tar.xz
# 'cd' into the extracted directory
cd $(find . -maxdepth 1 -type d -name "fish*")
# Build and install
cmake .
make
sudo make install
# Add to shells
echo /usr/local/bin/fish | sudo tee -a /etc/shells
# Set as user's shell
chsh -s /usr/local/bin/fish
# Delete build directory
popd
rm -rf $BUILD_DIR
@curtis628
Copy link
Author

To run this in a single command, run the following from your Pi's terminal.

Important! Before running commands/scripts from the internet, I strongly recommend you look at it first and make sure it looks okay.

$> /bin/bash -c "$(curl -fsSL https://gist.github.com/curtis628/07353525ad60234d03520ace3cf64c4e/raw/14a6cd38a2e297fb825ab4c81205d7ac20ab3f12/fish-build-install.sh)"

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