flutter error on ubuntu 18.04 'flutter' command not found - flutter

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

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/

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

Related

.bash: command still not found after adding path in M1 terminal (stacked_cli)

I have installed this CLI - https://stacked.filledstacks.com/docs/getting-started/overview
The downloaded file is saved in this folder user/.pub-cache/global_packages
When I typed stacked create app my_first_app
I got this error -bash: stacked: command not found
I can see that I added the path when I typed echo $PATH
From my terminal:
echo $PATH
/opt/homebrew/opt/dart#2.16/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/alexa/opt/anaconda3/bin:/Users/alexa/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/Cellar/ruby/2.5.1/bin:/Applications/XAMPP/xamppfiles/bin:/Applications/XAMPP/xamppfiles/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/XAMPP/xamppfiles/bin:/Users/alexa/.pub-cache/bin:/Users/alexa/Developer/flutter/bin
this is the path I added :/Users/alexa/.pub-cache/bin:
My login shell is /bin/bash and I saved the path to nano ~/.bash_profile
I have fixed it...looks like the problem was I didn't install the latest version of the CLI because I was using an older version of the Dart SDK. My Dart SDK was updated but I had to remove the path referencing the older version of the Dart SDK.

VSCode asdf-vm command no such file or directory

Specs
VSCode 1.63.2
Homebrew 3.3.10
asdf 0.9.0
MacOS Monterey
Problem
I installed asdf via Homebrew as per doc http://asdf-vm.com/guide/getting-started.html#_3-install-asdf
The asdf command works well in my iTerm. However, it didn't work when committing or pushing via VScode terminal and VSCode source control.
The error from VSCode terminal
Unknown command: `asdf exec npm run pre-commit`
/usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf: line 82: /usr/local/opt/asdf/lib/commands/command-help.bash: No such file or directory
And this below from VSCode source control
The error I got in output.
> git push origin feature/my-branch
Unknown command: `asdf exec npm run pre-commit`
/usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf: line 82: /usr/local/opt/asdf/lib/commands/command-help.bash: No such file or directory
Running asdf exec npm run pre-commit in my iTerm works well. There must be different configuration between zsh in iTerm vs in VSCode. 🤔
My attempt so far is to add this configuration in VSCode settings.json
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.defaultProfile.osx": "zsh"
but still not working
My ~/.zshrc setup for asdf
. /usr/local/opt/asdf/libexec/asdf.sh
What is the possible cause here?
Found dubious decision
I also dont have commands folder in asdf/lib
So I copied the same from asdf/libexec/lib
And it worked

"command not found: mongod" error despite updating PATH

I have added this line
export PATH=$PATH:"/Users/pouya/mongodb/bin:$PATH"
to my .bash_profile, but I still get this error:
zsh: command not found: mongod
I use macOS Catalina, and this happened to me with MongoDB.
I can't use Brew because of restrictions on my country and I want to install MongoDB manually, how can I do that?
For macOS Catalina the zsh is the default shell, so you should at this line to ~/.zshrc file
vim ~/.zshrc
export PATH=$PATH:"/Users/pouya/mongodb/bin:$PATH"
source ~/.zshrc

bash: /usr/bin/apt-get: cannot execute binary file: Exec format error

I'm having a few issues. I'm using Kali Linux. In the terminal, I attempted to do
apt-get update but I'm getting this message back,
'bash: /usr/bin/apt-get: cannot execute binary file: Exec format
error'
It started having this issue when I attempted to install Visual Studio Code via terminal command dpkg -i code_1.41.1-1576681836_amd64.deb. Although the vscode icon shows up in 'Accessories', once I try to open the program, it doesn't open. So I attempted to do the apt-get update just in case something was being missed. Any help would be greatly appreciated.

Flutter Doctor; command not found

Installing flutter using documentation for macOS. I entered the commands below:
$ unzip ~/Downloads/flutter_macos_v1.9.1+hotfix.6-stable.zip
$ export PATH="$PATH:'pwd'/flutter/bin"
and then try
$ flutter doctor , as instructed and get command not found
(also got command not found when trying 'flutter precache')
Do this
vi ~/.zshrc
then
export PATH="$PATH:/yourpath_to_/flutter/bin"
after that save doc
pres esc +:+!
after that
source ~/.zshrc
Add the following line and change "pwd" :
export PATH="$PATH:'pwd'/flutter/bin"
to be the path where you cloned Flutter’s git repo