Follow these steps to install Flutter on a Linux system.
-
Download Flutter:
- Go to the Flutter official website to get the latest download link.
- Download the Flutter tar.xz file using your web browser or a terminal command:
# Example command (change the URL if needed): wget https://example.com/path/to/flutter_linux.tar.xz
-
Install OpenJDK 17:
- You can install OpenJDK 17 using the following command:
sudo apt install openjdk-17-jdk
-
Edit your .bashrc file:
- Open your .bashrc file using a text editor:
nano ~/.bashrc
- Add the following lines to the bottom of the file. Make sure to adjust the paths as needed:
export PATH="$PATH:/path/to/flutter/bin" export CHROME_EXECUTABLE="/usr/bin/brave-browser-stable" export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
- Save and close the file.
-
Source your .bashrc to apply the changes:
source ~/.bashrc
-
Install Android SDK Command Line Tools:
- After installing Android Studio, open it.
- Go to "File" -> "Settings" (or "Android Studio" -> "Preferences" on macOS).
- In the left sidebar, navigate to "Appearance & Behavior" -> "System Settings" -> "Android SDK."
- Click on the "SDK Tools" tab.
- Check the "Android SDK Command-line Tools" option.
- Click "Apply" or "OK" to install the command-line tools.
-
Accept Android licenses:
- Run the following command to accept the Android licenses:
flutter doctor --android-licenses
Please make sure to verify the URLs and package names in the official documentation for any updates or changes that may have occurred after my last knowledge update.