I'm very new to using linux as my primary OS. Yesterday I just did a clean install of ubuntu on my pc. I after that I started setting up my desktop. Anything necessary is being installed to run flutter but whenever I run flutter
flutter: command not found
. I have tried seeing similar questions on stackoverflow but I do not see specific configuration of adding flutter to PATH on ubuntu and it is kinda confusing to me since I'm not experienced with linux for now.
When I enter the following export PATH="$PATH:development/flutter/bin"
command in the terminal, flutter is working but when I close that terminal in which I entered this command and boom, flutter is not being recognized in the console again.
What I want is flutter sdk to be added permanently to PATH so that I can access flutter
command whenever I want in the terminal.
I'm using ubuntu -v Ubuntu 18.04.3 LTS
.
Thank you.
Just edit the .bashrc file in your home directory and add
export PATH="$PATH:$HOME/[path to the directory you have installed flutter]/flutter/bin"
For example:
`export PATH="$PATH:$HOME/Documents/development/flutter/bin"`
Save the file and reopen the terminal
Go to your home folder and press Ctrl+H, to see hidden files. And open the .bashrc file.
Or, alternatively, put this in a terminal:
sudo gedit ~/.bashrc
2. Add a directory to your PATH variable (a global variable which tells your computer where to look for programs)
The last line of your .bashrc file should look something like this*:
export PATH="/home/tom/Flutter/flutter/bin/cache/dart-sdk/bin:${PATH}"
*If you want to add multiple new folders to your PATH variable, feel free to repeat this line as often as you'd like.
After you modify your path variable you should re-open your terminals.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With