How to Install Flutter on Ubuntu Linux ?

Flutter is a new way to build high-performance, cross-platform mobile apps. If you are new to Flutter, you may first read the more information about flutter at What is Flutter and Flutter Engine ? and you can find lot of other related articles about flutter at HERE

Now, lets get back to action, and install Flutter on Ubuntu. At the time of writing this article, we were using “Ubuntu 18.04.2 LTS”on 64 bit Laptop

$ mkdir ubuntu
$ cd ubuntu

Verify commands like “rm”, “which” and “mkdir” are present on your ubuntu machine (Which most likely would be present, you can verify by typing command “which” on terminal and then “which rm”, “which mkdir”)

We will need to install the dependent packages as,

$ sudo apt-get install bash curl git unzip xz-utils libglu1-mesa

On Ubuntu If you face an error like as below,
“E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?”

Run the command,

$ sudo apt-get --fix-missing

and then again, type command,

$ sudo apt-get install bash curl git unzip xz-utils libglu1-mesa

Download Flutter SDK

$ mkdir development
$ cd development
$ wget -c https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_v1.5.4-hotfix.2-stable.tar.xz

You can download Latest Stable version from https://flutter.dev/docs/development/tools/sdk/releases?tab=linux

$ tar xvf flutter_linux_v1.5.4-hotfix.2-stable.tar.xz

Add the flutter tool to your path:

$ export PATH="$PATH:`pwd`/flutter/bin"

This command sets your PATH variable for the current terminal window only. Now, check if Flutter has been added to your path as,

$ which flutter
/home/devlab/devlab/flutter/ubuntu/devlopment/flutter/bin/flutter

You can add this command permanantly to your path by modifying .bashrc file as below,

$ vim ~/.bashrc

Add your flutter bin directory path as below [ Note: Our extracted flutter SDK was present at “/home/devlab/devlab/flutter/ubuntu/devlopment/flutter” hence above command has shown the same path in “which” command

Go to last, and append following line by modifying your proper path

export PATH=$PATH:YOUR_FLUTTER_SDK_PATH/flutter/bin

Now, open a new terminal and if you type flutter command, it should show the help, it means flutter SDK path has bin added to your terminal PATH

Once you Installed Flutter, follow our next post “Setting up Flutter development Environment for Ubuntu Linux and Verify using “flutter doctor”

Leave a Comment