Skip to content

Instantly share code, notes, and snippets.

@AFRUITPIE
Last active March 5, 2024 16:15
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 13 You must be signed in to fork a gist
  • Save AFRUITPIE/1d26d3d15dc43f821a36d7ccc1260a7f to your computer and use it in GitHub Desktop.
Save AFRUITPIE/1d26d3d15dc43f821a36d7ccc1260a7f to your computer and use it in GitHub Desktop.
Install Fish Shell 3+ on Raspberry Pi
#!/bin/bash
# This is a quick installer
# script I made to build and install the latest version of
# fish on my Raspberry Pi.
#
# Use at your own risk as I have made no effort to make
# this install safe!
set -e
FISH_VERSION="3.1.2"
# Install dependencies
sudo apt-get install build-essential cmake ncurses-dev libncurses5-dev libpcre2-dev gettext
# Create a build directory
mkdir fish-install
cd fish-install
# Download and extract the latest build (could clone from git but that's less stable)
wget https://github.com/fish-shell/fish-shell/releases/download/$FISH_VERSION/fish-$FISH_VERSION.tar.gz
tar -xzvf fish-$FISH_VERSION.tar.gz
cd fish-$FISH_VERSION
# 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
cd ../../
rm -rf fish-install
@Brandonshire
Copy link

I managed to get this working with the latest version of Fish, though there were a few additional changes that had to be made, as the latest versions of Fish use .xz files rather than .gz. You can see my fork for the updated script.

@curtis628
Copy link

FWIW - I also created a fork which includes

  • automatically downloading and installing latest version
  • shows how to run the script in a single command

I'm sure my version could be improved a bunch also... but I thought I'd share this here in case it helps someone else.

@AFRUITPIE
Copy link
Author

Thanks!

For what it's worth, sudo apt-get install fish worked for me while setting up my new Pi so I don't think building from source is required anymore.

@Brandonshire
Copy link

Excellent!

@tmsquill
Copy link

tmsquill commented Mar 5, 2024

The sudo apt-get install fish works for me as well, thanks!

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