1.3 Install Flutter In Linux

In this article, we will introduce how to install Flutter in Linux. System requirements To install and run Flutter, your development environment must meet these minimum requirements: Operating Systems: Linux (64-bit) Disk Space: 600 MB (does not include disk space for IDE/tools). Tools: Flutter depends on these command-line tools being available in your environment. bash […]

In this article, we will introduce how to install Flutter in Linux.

System requirements

To install and run Flutter, your development environment must meet these minimum requirements:

  • Operating Systems: Linux (64-bit)
  • Disk Space: 600 MB (does not include disk space for IDE/tools).
  • Tools: Flutter depends on these command-line tools being available in your environment.
    • bash
    • curl
    • file
    • git 2.x
    • mkdir
    • rm
    • unzip
    • which
    • xz-utils
    • zip
  • Shared libraries: Flutter test command depends on this library being available in your environment.
    • libGLU.so.1 - provided by mesa packages such as libglu1-mesa on Ubuntu/Debian and mesa-libGLU on Fedora.

Get the Flutter SDK

On Linux, you have two ways you can install Flutter.

Install Flutter using snapd

The easiest way to install Flutter on Linux is by using snapd. For more information, see Installing snapd.

Once you have snapd, you can install Flutter using the Snap Store, or at the command line:

sudo snap install flutter --classic

Note:

Once the snap is installed, you can use the following command to display your Flutter SDK path:

flutter sdk-path

Install Flutter manually

If you don’t have snapd, or can’t use it, you can install Flutter using the following steps.

  1. Go to flutter official website to download the latest available installation package

  2. Extract the file in the desired location, for example:

    cd ~/development
    tar xf ~/Downloads/flutter_linux_x.x.x-stable.tar.xz
  3. Add the flutter tool to your path:

    export PATH="$PATH:<code>pwd/flutter/bin"
  4. Optionally, pre-download development binaries:

    The flutter tool downloads platform-specific development binaries as needed. For scenarios where pre-downloading these artifacts is preferable (for example, in hermetic build environments, or with intermittent network availability), iOS and Android binaries can be downloaded ahead of time by running:

    flutter precache

    For additional download options, see flutter help precache.

You are now ready to run Flutter commands!

Run flutter doctor

Run the following command to see if there are any dependencies you need to install to complete the setup (for verbose output, add the -v flag):

flutter doctor

This command checks your environment and displays a report to the terminal window. The Dart SDK is bundled with Flutter; it is not necessary to install Dart separately. Check the output carefully for other software you might need to install or further tasks to perform (shown in bold text).

For example:

[-] Android toolchain - develop for Android devices
    • Android SDK at /Users/obiwan/Library/Android/sdk
    ✗ Android SDK is missing command line tools; download from https://goo.gl/XxQghQ
    • Try re-installing or updating your Android SDK,
      visit https://flutter.dev/setup/#android-setup for detailed instructions.

We will perform these tasks and complete the setup process in the "1.4 Android Setup" article.

Once you have installed any missing dependencies, you can run the flutter doctor command again to verify that you’ve set everything up correctly.

Author: Hi, I’m iBllex

I am a freelancer. Currently working on Golang, PHP, WordPress, React, Vue, TypeScript, Flutter and other technologies.

Leave a Reply

Your email address will not be published. Required fields are marked *