Swtching Flutter from snap to native
A recent update saw Flutter compiles on Ubuntu broken due to an issue with lld. This was only on Flutter installed under snap. To fix it, I removed Flutter and reinstalled it from Git. There were a few issues after that so I’ve documented them here. This is the process.
First remove Flutter
sudo snap remove flutter
Then install it manually
cd ~
git clone https://github.com/flutter/flutter.git -b stable
Now modify .bashrc (I prefer gedit but nano will do)
nano ~/.bashrc
Add this line at the end:
export PATH="$PATH:$HOME/flutter/bin"
Save it then do
source ~/.bashrc
Test the installation
flutter doctor
There may be some missing bits but this should fix them
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
and repeat flutter doctor until things are ok.
Now I still had some issues
Flutter doctor told me I had a different Dart installed.
So first remove the old one
sudo snap remove dart
Check with
which dart
My configuration still had the wrong dart in it. I searched these
cat /etc/environment cat ~/.profile cat ~/.bash_profile cat /etc/bash.bashrc grep -r "dart" ~/.bashrc ~/.bash_profile ~/.profile /etc/environment /etc/bash.bashrc 2
then did
echo $PATH
Which showed no dart references so
ls -la /usr/bin/dart which dart sudo apt remove dart which dart dart --version flutter doctor
I then found that it was trying to use a snap version of cmake
cd your_project flutter clean rm -rf build/ rm -rf linux/build/
and removed Cmake cache files
rm -rf linux/flutter/ephemeral/ rm linux/CMakeCache.txt 2>/dev/null
Finally I regenerated the build configuration
flutter pub get flutter config --enable-linux-desktop flutter create
and all was well and after adding the correct SDK path into the project files, it finally compiled on Linux again. Phew!
So I’ve been working on my game and to save time build the web project as a Linux app. It compiles it and runs it quicker than doing it with Chrome. Until yesterday.
One of Flutter’s big strengths is its supports for theming; you can define or change colours for every aspect of your UI but it can be a bit complicated. Now an open source project provides a way to simplify things. It’s called 



I run Ubuntu in a hyper-V session. It works very well and handy for getting screenshots. I’ve been using a 24.04 LTS for a while and decided I needed another one to test CyberPanel. i already have Webmin on my main one so wanted a clean Ubuntu so as not to mess Webmin. It took ten minutes to setup then another 20 minutes to install 300+ updates.
