No description
Find a file
2025-09-07 15:13:16 +02:00
install_fish.sh V2 2025-08-20 00:40:29 +02:00
README.md Update README.md 2025-09-07 15:13:16 +02:00

Fish Shell Installer

A comprehensive shell script to install Fish shell from source and set it as the default shell across multiple operating systems.

Supported Operating Systems

  • Debian/Ubuntu - Uses apt-get package manager
  • Rocky Linux/CentOS/RHEL - Uses yum/dnf package manager
  • SUSE/openSUSE - Uses zypper package manager
  • Arch Linux - Uses pacman package manager
  • macOS - Uses Homebrew package manager
  • Other Unix-like systems - Manual dependency installation required

Features

  • 🚀 Automatic OS detection - Identifies your system and installs appropriate dependencies
  • 🔧 Source compilation - Builds Fish shell from latest source code for optimal performance
  • 📦 Dependency management - Installs all required build dependencies automatically
  • 🐚 Default shell setup - Configures Fish as your default shell
  • ⚙️ Configuration setup - Creates basic Fish configuration with useful aliases
  • Installation verification - Tests the installation to ensure everything works
  • 🎨 Colored output - Clear, informative installation progress with color coding

Prerequisites

  • A Unix-like operating system
  • Sudo privileges (for non-root users) OR root access
  • Internet connection (for downloading source code and dependencies)
  • At least 500MB free disk space

Quick Installation

  1. Download the script:

    curl -O https://git.pandem.fr/gabriel/fish_installer/raw/branch/main/install_fish.sh
    
  2. Make it executable:

    chmod +x install_fish.sh
    
  3. Run the installer:

    # As regular user (recommended)
    ./install_fish.sh
    
    # As root user
    sudo ./install_fish.sh
    

Manual Installation

If you prefer to clone the repository:

git clone https://git.pandem.fr/gabriel/fish_installer.git
cd fish-installer
chmod +x install_fish.sh
./install_fish.sh

What the Script Does

  1. OS Detection - Automatically identifies your operating system
  2. Dependency Installation - Installs build tools and libraries needed to compile Fish
  3. Source Download - Downloads the latest Fish shell source code from GitHub
  4. Compilation - Builds Fish shell from source with optimized settings
  5. Installation - Installs Fish to /usr/local/bin/fish
  6. Shell Configuration - Adds Fish to /etc/shells and sets it as default
  7. User Setup - Creates basic Fish configuration with useful aliases
  8. Verification - Tests the installation to ensure everything works

Post-Installation

After successful installation:

  1. Log out and log back in for the new default shell to take effect
  2. Start Fish manually with: fish
  3. Customize configuration at: ~/.config/fish/config.fish
  4. Install Oh My Fish for additional features:
    curl -L https://get.oh-my.fish | fish
    

Fish Shell Features

  • Intelligent autosuggestions - Fish learns from your command history
  • Syntax highlighting - Commands are highlighted as you type
  • Web-based configuration - Easy configuration through fish_config command
  • Extensible with plugins - Rich ecosystem of plugins and themes
  • Cross-platform compatibility - Works on Linux, macOS, and other Unix systems

Troubleshooting

Common Issues

Permission Denied:

chmod +x install_fish.sh

Sudo Required (for non-root users): The script needs sudo privileges to install dependencies and Fish when run as a regular user.

Root Execution: The script can also run as root, but this is not recommended for security reasons. When running as root, the script will install Fish for the root user and ask for confirmation.

Build Failures:

  • Ensure you have sufficient disk space (at least 500MB)
  • Check that all dependencies were installed correctly
  • Verify your system has the required build tools

Fish Not Found After Installation:

  • Log out and log back in
  • Or manually start Fish with: fish
  • Check PATH: echo $PATH

Manual Dependency Installation

If automatic dependency installation fails, install manually:

Debian/Ubuntu:

sudo apt-get install build-essential cmake pkg-config libncurses5-dev gettext libssl-dev libpcre2-dev libreadline-dev

CentOS/RHEL/Rocky:

sudo yum groupinstall "Development Tools"
sudo yum install cmake pkg-config ncurses-devel gettext openssl-devel pcre2-devel readline-devel

macOS:

brew install cmake pkg-config ncurses gettext openssl pcre2 readline

Customization

Update Fish Version

Edit the script and change the FISH_VERSION variable:

FISH_VERSION="3.7.1"  # Change to desired version

Modify Installation Path

Change the CMAKE_INSTALL_PREFIX in the build function:

cmake .. -DCMAKE_INSTALL_PREFIX=/opt/fish  # Custom path

Add Custom Dependencies

Modify the install_dependencies() function to add your own packages.

Security Notes

  • The script downloads and compiles source code from the official Fish shell repository
  • All downloads use HTTPS for security
  • The script requires sudo privileges but runs as a regular user
  • Temporary build files are automatically cleaned up after installation

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for:

  • Additional OS support
  • Bug fixes
  • Feature enhancements
  • Documentation improvements

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Fish shell developers for creating an excellent shell
  • Various Linux distributions for their package management systems
  • Homebrew team for macOS package management

Note: This script is designed for educational and development purposes. Always review scripts before running them on production systems.