Skip to content

Instantly share code, notes, and snippets.

@asad-albadi
Created September 9, 2023 15:52
Show Gist options
  • Save asad-albadi/19d681bd4d8bc59f18aea2efccdf1dfc to your computer and use it in GitHub Desktop.
Save asad-albadi/19d681bd4d8bc59f18aea2efccdf1dfc to your computer and use it in GitHub Desktop.
Flutter Installation Guide for Linux

Flutter Installation Guide for Linux

Follow these steps to install Flutter on a Linux system.

  1. Download Flutter:

    • Go to the Flutter official website to get the latest download link.
    • Download the Flutter tar.xz file using your web browser or a terminal command:
    # Example command (change the URL if needed):
    wget https://example.com/path/to/flutter_linux.tar.xz
  2. Install OpenJDK 17:

    • You can install OpenJDK 17 using the following command:
    sudo apt install openjdk-17-jdk
  3. Edit your .bashrc file:

    • Open your .bashrc file using a text editor:
    nano ~/.bashrc
    • Add the following lines to the bottom of the file. Make sure to adjust the paths as needed:
    export PATH="$PATH:/path/to/flutter/bin"
    export CHROME_EXECUTABLE="/usr/bin/brave-browser-stable"
    export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
    • Save and close the file.
  4. Source your .bashrc to apply the changes:

    source ~/.bashrc
  5. Install Android SDK Command Line Tools:

    • After installing Android Studio, open it.
    • Go to "File" -> "Settings" (or "Android Studio" -> "Preferences" on macOS).
    • In the left sidebar, navigate to "Appearance & Behavior" -> "System Settings" -> "Android SDK."
    • Click on the "SDK Tools" tab.
    • Check the "Android SDK Command-line Tools" option.
    • Click "Apply" or "OK" to install the command-line tools.
  6. Accept Android licenses:

    • Run the following command to accept the Android licenses:
    flutter doctor --android-licenses

Please make sure to verify the URLs and package names in the official documentation for any updates or changes that may have occurred after my last knowledge update.

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