In this article, we will delve into a step-by-step guide on how to set up Flutter on Ubuntu 22.04 LTS. Flutter, an open-source UI software development kit from Google, is widely used by developers and organizations globally to create high-quality native interfaces on iOS, Android, and Google Fuchsia.
Updating System Packages
First, we need to make sure all the system packages are up-to-date. Use the following commands:
sudo apt update sudo apt upgrade
Installing Dependencies
Next, install the required dependencies with the following command:
sudo apt install curl file git unzip xz-utils zip libglu1-mesa
Downloading and Installing Flutter
To download the latest stable release of Flutter SDK, use:
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.16.9-stable.tar.xz
After download, extract the file to a location of your choice, such as ~/development, using:
tar xf ~/Downloads/flutter_linux_3.16.9-stable.tar.xz -C ~/development
Adding Flutter to PATH
For Flutter commands to work in your terminal, you need to add Flutter to your PATH. You can do this temporarily using:
export PATH="$PATH:`pwd`/flutter/bin"
For a permanent solution, add the above export command to your .bashrc or .profile file. Reload the shell configuration afterward using either:
source ~/.bashrc
Or:
source ~/.profile
Running Flutter Commands
With Flutter installed, validate the setup and check for any missing dependencies using:
flutter doctor
If you plan to develop for Android, agree to the Android SDK licenses with:
flutter doctor --android-licenses
Verifying Installation
To verify the installation, create and run a new Flutter project using:
flutter create my_flutter_app cd my_flutter_app flutter run
If everything went according to plan, you should have successfully installed Flutter on Ubuntu 22.04 LTS.
Before we end this article, we’d like to mention Shape.host’s Linux SSD Vps services. If managing VPS isn’t your cup of tea or you simply don’t have time, Shape.host offers a VPS Manage Service starting from $4. They provide efficient, scalable, and secure cloud hosting solutions. For more information, you can check their official website.