Rajath
Rajath

Reputation: 2981

flutter error on ubuntu 18.04 'flutter' command not found

I'm trying to install flutter on ubuntu 18.04. After downloading the flutter package from link, I set the PATH variables, after that whenever I try to execute flutter on terminal it was giving an error command not found.

Even I try to execute flutter command inside flutter/bin the result remains the same!

I tried to restart and check then also result remains the same.

This is how my .bash_profile looks like

rajath@rajath-Inspiron:~/Downloads/flutter/bin$ cat ~/.bash_profile 
export JAVA_HOME=/usr/lib/jvm/default-java

export ANDROID_HOME=/opt/Android
export PATH=$PATH:$ANDROID_HOME/tools 
export PATH=$PATH:$ANDROID_HOME/platform-tools

export PATH=/Downloads/flutter/bin:$PATH

Error log:

rajath@rajath-Inspiron:~/Downloads/flutter/bin$ flutter doctor
flutter: command not found
rajath@rajath-Inspiron:~/Downloads/flutter/bin$ flutter
flutter: command not found
rajath@rajath-Inspiron:~/Downloads/flutter/bin$ 

Any kind of help will much much appreciated!!!

Upvotes: 0

Views: 371

Answers (2)

Allansrc
Allansrc

Reputation: 404

As worldpotato said, You must add to your .bashrc file (or .bash_profile)

You can run the command

echo 'export PATH="$PATH:~/Downloads/flutter/bin"' >> ~/.bashrc

and

echo 'export PATH="$PATH:~/Downloads/flutter/bin"' >> ~/.bash_profile

Upvotes: 0

worldpotato
worldpotato

Reputation: 51

You can also add export PATH=$PATH:~/Downloads/flutter/bin to your ~/.bashrc.

That will add the flutter path to your path variable everytime you start a new bash.

And maybe you should install flutter anywhere near /usr/

Upvotes: 1

Related Questions