Skip to content
The Chat Archive
claude-opus-4-20250514-thinking-16k· Anthropic LMArena Human Preference 140K

How do I set up Bluefin Linux for Flutter development?

  1. User

    How do I set up Bluefin Linux for Flutter development?

  2. Assistant

    Bluefin Linux is an immutable Fedora-based operating system that's designed for developers. Since it's immutable, the approach to setting up Flutter is different from traditional Linux distributions. Here's the recommended way to set up Flutter development on Bluefin:

    Recommended Approach: Using Distrobox

    Bluefin comes with Distrobox pre-installed, which is perfect for creating isolated development environments without modifying the base system.

    Step 1: Create a Development Container

    # Create an Ubuntu-based container for Flutter development
    distrobox create --name flutter-dev --image ubuntu:22.04
    
    # Enter the container
    distrobox enter flutter-dev
    

    Step 2: Install Flutter Dependencies (Inside the Container)

    Once inside the container, run these commands:

    # Update package lists
    sudo apt update
    
    # Install required dependencies
    sudo apt install -y \
        curl \
        git \
        unzip \
        xz-utils \
        zip \
        libglu1-mesa \
        build-essential \
        openjdk-17-jdk
    
    # Install additional tools for Linux desktop development
    sudo apt install -y \
        clang \
        cmake \
        ninja-build \
        pkg-config \
        libgtk-3-dev \
        liblzma-dev
    

    Step 3: Install Flutter SDK

    # Create a directory for development tools
    mkdir -p ~/development
    cd ~/development
    
    # Clone Flutter repository
    git clone https://github.com/flutter/flutter.git
    cd flutter
    git checkout stable
    
    # Add Flutter to PATH (add this to ~/.bashrc for persistence)
    echo 'export PATH="$PATH:$HOME/development/flutter/bin"' >> ~/.bashrc
    source ~/.bashrc
    
    # Verify installation
    flutter doctor
    

    Step 4: Install Android SDK (for Android Development)

    # Create Android SDK directory
    mkdir -p ~/Android/Sdk
    cd ~/Android/Sdk
    
    # Download Android command line tools
    wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
    unzip commandlinetools-linux-9477386_latest.zip
    rm commandlinetools-linux-9477386_latest.zip
    
    # Set up the directory structure
    mkdir -p cmdline-tools/latest
    mv cmdline-tools/* cmdline-tools/latest/ 2>/dev/null || true
    
    # Add Android SDK to PATH
    echo 'export ANDROID_HOME="$HOME/Android/Sdk"' >> ~/.bashrc
    echo 'export PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools"' >> ~/.bashrc
    source ~/.bashrc
    
    # Accept licenses and install components
    yes | sdkmanager --licenses
    sdkmanager "platform-tools" "platforms;android-33" "build-tools;33.0.2"
    

    Step 5: Configure VS Code Integration

    From your Bluefin host system:

    # Install VS Code (if not already installed)
    flatpak install flathub com.visualstudio.code
    
    # Install the Flutter and Dart extensions in VS Code
    

    To use VS Code with your Distrobox container:

    1. Open VS Code
    2. Install the "Dev Containers" extension
    3. Use the command palette (Ctrl+Shift+P) and run "Dev Containers: Attach to Running Container"
    4. Select your flutter-dev container

    Step 6: Create Desktop Entry for Easy Access

    Create a script to quickly enter your Flutter environment:

    # Create the script
    cat > ~/.local/bin/flutter-dev << 'EOF'
    #!/bin/bash
    distrobox enter flutter-dev
    EOF
    
    # Make it executable
    chmod +x ~/.local/bin/flutter-dev
    

    Alternative: Using Toolbox

    If you prefer Fedora-based environments, you can use Toolbox instead:

    # Create a Fedora toolbox
    toolbox create flutter-dev
    
    # Enter the toolbox
    toolbox enter flutter-dev
    
    # Install dependencies
    sudo dnf install -y \
        git \
        curl \
        unzip \
        which \
        mesa-libGLU \
        java-17-openjdk-devel \
        clang \
        cmake \
        ninja-build \
        gtk3-devel
    
    # Then follow steps 3-4 above to install Flutter and Android SDK
    

    Tips for Bluefin Flutter Development

    1. Emulator Access: Android emulators should run on your host system. From within your container, connect using:

      adb connect host.containers.internal:5555
      
    2. Physical Device Access: To access USB devices from the container:

      # Exit to host, then re-enter with USB access
      distrobox enter flutter-dev -- --device /dev/bus/usb
      
    3. Persistent Storage: Your home directory is automatically mounted in Distrobox containers, so your projects and SDKs persist.

    4. GUI Applications: Flutter apps with Linux desktop targets will run seamlessly thanks to Distrobox's X11/Wayland integration.

    5. Multiple Flutter Versions: Create separate containers for different Flutter versions:

      distrobox create --name flutter-stable --image ubuntu:22.04
      distrobox create --name flutter-beta --image ubuntu:22.04
      

    Advantages of This Setup

    • Immutable Host: Your Bluefin system stays clean and stable
    • Easy Cleanup: Just delete the container to remove everything
    • Version Management: Different containers for different Flutter/SDK versions
    • Team Consistency: Share the exact container configuration with teammates
    • Bluefin Philosophy: Aligns with Bluefin's containerized development approach

    This setup gives you a fully functional Flutter development environment while maintaining the benefits of Bluefin's immutable design.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.