Last active
May 30, 2024 16:12
-
-
Save iifast2/03cce3d8a397f445f5932c506285529c to your computer and use it in GitHub Desktop.
Flutter 3.19.x installation script for ubuntu/trusty64 & ubuntu server 22.04 LTS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Update the package list | |
sudo apt update | |
# Install necessary packages | |
sudo apt install -y git wget unzip curl xz-utils | |
# Download Flutter | |
FLUTTER_VERSION="3.19.6-stable" | |
FLUTTER_ARCHIVE="flutter_linux_$FLUTTER_VERSION.tar.xz" | |
FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/$FLUTTER_ARCHIVE" | |
curl -O $FLUTTER_URL | |
# Extract Flutter | |
tar xf $FLUTTER_ARCHIVE | |
# Move Flutter to /opt directory | |
sudo mv flutter /opt/flutter | |
# Clean up the downloaded archive | |
rm -R $FLUTTER_ARCHIVE | |
# access as admin | |
sudo -s | |
# Add Flutter and Dart to the PATH env | |
echo -e "\n# Flutter & Flutter bin Path\nexport PATH=\"\$PATH:/opt/flutter/bin\"\n\n# Set Flutter and Dart Home\nexport FLUTTER_HOME=/opt/flutter\nexport DART_HOME=\$FLUTTER_HOME/bin" >> ~/.bashrc | |
# Apply the changes | |
source ~/.bashrc | |
# Verify the installation | |
/opt/flutter/bin/flutter doctor | |
#flutter --version | |
#dart --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment