How to install Fish on Ubuntu
If you know what you're doing, here's a simple Copy 'n' Paste solution to install Fish as your default shell on pretty much any debian system.
bash -c ' if [ ! "$(which apt-add-repository 2>/dev/null)" ]; then sudo apt-get install --yes python-software-properties || \ sudo apt-get install --yes software-properties-common fi sudo apt-add-repository ppa:fish-shell/release-2 sudo apt-get update sudo apt-get install --yes fish echo "Setting $(whoami)'"'"'s default shell to $(which fish)" sudo chsh -s $(which fish) $(whoami) '
The whole thing is wrapped in
bash -c '...' for two reasons:
- Normally prompts for your password, asking you to hit 'y' to confirm, etc would disrupt the input flow and break your ability to easily copy and paste. Quoting the whole thing makes it function as a script.
- There are a few bash-isms - such as the 'if' and the '$(...)'. Explicitly running the block as bash assures that even if you're currently an sh, csh, or zsh, the bash-isms won't break you.
For those that care to read:
First we add the fish ppa to the system
sudo apt-add-repository ppa:fish-shell/release-2
Then we update the list of available software
sudo apt-get update
After which we install fish:
sudo apt-get install --yes fish
And then set fish to be the current shell
sudo chsh -s $(which fish) $(whoami)
By AJ ONeal
Was this useful to you? Share it!give me a tip or hire me.