0

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!!!

8
  • 1
    try: rajath@rajath-Inspiron:~/Downloads/flutter/bin$ ./flutter doctor Commented Jun 2, 2019 at 4:22
  • by the way why my env PATH are not working? Commented Jun 2, 2019 at 4:28
  • basically your PATH is incorrect: export PATH= ~/Downloads/flutter/bin:$PATH - notice ~ before /Downloads/... Commented Jun 2, 2019 at 4:28
  • needs to restart after this? Commented Jun 2, 2019 at 4:32
  • no, just reload your .bash_profile Commented Jun 2, 2019 at 4:33

2 Answers 2

1

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/

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.