Sometimes it seems really difficult to setup a suitable environment in order to perform or learn a particular task. For example if you want to cook chicken or , the difficult part is the cleaning than the actually cooking part. This also applies in other domains. Do you have some troubles setting up your environment in other to start learning a new tool ? Then you are in the right place today I will explain you how to install flutter on Linux in just few steps. If you are don not know what flutter is or if you are not familiar with this tool her is an introduction on flutter. Feel free to read and share your impressions.
Flutter can be installed using snap or you can go through the manual installation. Don’t worry I will provide both way so you can choose the one that suit you.
How to install flutter using snap
The simplest way to install flutter on Linux is through the snap command. Thanks some distributions of Linux such as KDE Neon, Manjaro, Solus 3 and above, Ubuntu 20.04 LTS (Focal Fossa), Ubuntu 18.04 LTS (Bionic Beaver), Ubuntu 16.04.4 LTS (Xenial Xerus)Ubuntu 20.04 LTS (Focal Fossa) come with snap pre-installed. But if you don’t have have snap install don’t worry just install it then run the command below to install Flutter.
kevine@kevine-Latitude-E6430:~$ sudo snap install flutter --classic
Once it’s install run the following command in order to display your flutter SDK path.
How to install flutter manually
If you do not desire to use snap or if you can’t use snap, just follow these steps in order to get set.
1) Download the installation bundle from the link below. Make sure you get the latest stable release of the Flutter SDK
2) Extract the file in the desired location, for example:
kevine@kevine-Latitude-E6430:~$ tar xf ~/Downloads/flutter_linux_1.22.5-stable.tar.xz
Alternatively you can skip these two steps and install from the github repository with the following command
kevine@kevine-Latitude-E6430:~$ git clone https://github.com/flutter/flutter.git
3) Next you should add the
flutter tool to your path:
kevine@kevine-Latitude-E6430:~$ export PATH="$PATH:`pwd`/flutter/bin"
Note that this command sets your
PATH variable for the current terminal window only. If you will like to set the path permanently you can follow these steps
Now if you have successfully perform the above steps then you should be ready to use the flutter command
4) Finally run the flutter doctor command to make sure all the dependencies needed are installed:
kevine@kevine-Latitude-E6430:~$ flutter doctor
Don’t bother if you do not have all the dependencies installed. In the next articles I will provide you with a short tutorial on how to install all the missing dependencies.