31.1 Flutter Install Linux
20241027
The recommended install from Flutter for a user:
sudo apt-get update -y && sudo apt-get upgrade -y;
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa
sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.4-stable.tar.xz
mkdir ~/development
tar -xvf flutter_linux_3.24.4-stable.tar.xz -C ~/development/
echo 'export PATH="~/development/flutter/bin:$PATH"' >> ~/.bash_profile
The Ubuntu guide to an initial install on Ubuntu begins with a snap install:
At times the snap install has been problematic.
Running the flutter command will then initialise
the installation and the doctor
command will review the
installation.
If you will be targeting Android devices then you will need to install android-studio and then through android-studio install the sdk and the command-line tools (under Customize, All settings…, then Languages & Frameworks, then AndroidSDK and SDK Tools then check Android SDK Command-line Tools (latest) as confirmed 20231223):
To enable an Android device to be the target of a Flutter build, on the device turn on Developer Mode (in Settings go to About and then tap the Build Number seven times). Then under Settings again go to the System option then Developer Options to then enable USB Debugging. Plug your device via USB into your computer and tap Allow on the popup on your device. Then you should be able to see your device from Flutter:
$ flutter devices
Found 3 connected devices:
Pixel 7a (mobile) • 13414KNRG13446 • android-arm64 • Android 14 (API 34)
Linux (desktop) • linux • linux-x64 • Ubuntu 23.10 6.5.0-14-generic
Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.129
For the latest developer version of flutter:
Ensure support for desktop application development:
flutter config --enable-linux-desktop
flutter config --enable-macos-desktop
flutter config --enable-windows-desktop
Check everything is okay:
To then create, build, and run a sample linux desktop application
named button
, specifying the target device id with -d
:
Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0