port command not found - macos

I am trying to install XFig and found this post. But when I tried to sudo port selfupdate I get the error sudo: port: command not found.
I am using zsh and tried to modify the path according to this in both .zshrc and .bash_profile but still no luck.
The current PATH in .zshrc file looks like this
export PATH="/Users/chintanshah/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

You need /opt/local/bin in the $PATH.
To add to $PATH:
export PATH=/opt/local/bin:$PATH

Related

remove .zprofile:1: no such file or directory: from terminal

Every time I open terminal I get:
/Users/me/.zprofile:1: no such file or directory: /opt/homebrew/bin/brew
/Users/me/.zprofile:2: no such file or directory: /opt/homebrew/bin/brew
Can someone help how to remove this?
.zprofile is generally used as a profile config file for Z shell. In OSX if you've installed brew using Rosetta terminal the exec location would be most likely in /usr/local/bin/brew. You can replace /opt/homebrew/bin/brew with this location or you can just check it using which brew to get the bin location of homebrew and replace it in .zprofile file.

How can I change PATH?

Im trying to use git for my very first project on terminal but it says zsh: command not found: git so I tried to download git by downloading homebrew first but guess what it says zsh: command not found: curl. So apparently all commands is not working on my terminal and I have no idea why.
I also tried this export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" but this is only temporary.
How Can I fix my PATH??
Since macOS Catalina, you can define the PATH environment variable in the ~/.zshrc file with:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
you can then add more entries to an existing PATH environment variable with:
export PATH="/usr/local/opt/ruby/bin:$PATH"

unable to setup ssldump on mac using homebrew

I just installed ssldump on a mac computeg using brew. The installation process ran without reporting any issues (ssldump-0.9b3 already installed). However, when I try running ssldump from the same prompt or a new terminal window, the error message I get is:
-bash: ssldump: command not found
Is there anything else that i need to do to make this work on a Mac El capitan (v10.11.6)?
Simply using brew install ssldump did not work for me as ssldump was added in /usr/local/sbin (which was neither mentioned on /etc/paths nor in .bash_profile). I ended up adding /usr/local/sbin to the .bash_profile and used sourced the file to enable the change.
cd ~
sudo vi .bash_profile
add to the file:
export PATH=/usr/local/sbin:$PATH
&
source .bash_profile

Laravel "valet install" not found

I am trying to set up Laravels Valet (Valet is a Laravel development environment for Mac). Everything works until it comes to the command "valet install". This command must be executed in terminal. But I got the error "command not found". Any ideas, why? Do I have to update my PATH or something else?
I switched to OS X a few days ago. Before that, I was a windows user. So I am a total newbie.
Yes, you need to make sure that ~/.composer/vendor/bin directory is in your system's PATH, you can check this by running:
echo $PATH
If you can't see it there, then you need to add this to your ~/.bash_profile:
export PATH=$PATH:~/.composer/vendor/bin
If you're getting the error message "valet: command not found", it's likely that PHP's Composer is not in your PATH variable, for instance:
$ valet install
-bash: valet: command not found
You can confirm if Laravel Valet was successfully installed by running the following command:
ls -al ~/.composer/vendor/bin/valet
If successfull, you'll see the symlink for Valet in Composer's bin directory pointing to Laravel in the vendor directory:
~/.composer/vendor/bin/valet# -> ../laravel/valet/valet
To test whether your PATH is missing Composer, try running the Valet command directly:
~/.composer/vendor/bin/valet --version
If you're shown the Laravel version number, (e.g. Laravel Valet 2.0.4), this indicates Valet is installed but you need to update your PATH variable to include Composer for the valet command to work globally.
In your Terminal, execute the following command which will append Composer to your shell's PATH:
export PATH=$PATH:~/.composer/vendor/bin
For the changes to take effect, you'll need to exit and re-open your Terminal window or tab.
Alternatively, you can simply source your shell's profile, which doesn't require quitting your active session:
source ~/.bash_profile
If you have a different shell environment or you're using a shell other than Bash, you will need to source its configuration profile instead (e.g. .bashrc, .zshrc, config.fish).
I'm using oh-my-zsh so:
echo "export PATH=$PATH:$HOME/.config/composer/vendor/bin" >> ~/.zshrc
source ~/.zshrc
You may replace .zshrc with .bashrc
you just have to use:
export PATH="$PATH:$HOME/.composer/vendor/bin"
then
valet install
ready :)
Make sure that ~/.composer/vendor/bin directory is in your system's PATH, you can check this by running:
echo $PATH
If not there, open your ~/.bash_profile and add this code:
export PATH=$PATH:~/.composer/vendor/bin
Then run:
composer global require laravel/valet --dev
Once it is done, run:
valet install
If valet install doesn’t work, but ~/.composer/vendor/bin/valet --version does work, try installing it via
~/.composer/vendor/bin/valet install
To See if that worked, check
valet --version
If you're using zsh, you cannot use ~ as path to home dir, use $HOME instead.
In .zshrc file, instead of adding this:
export PATH=$PATH:~/.composer/vendor/bin
Add this and the path will resolve:
export PATH=$PATH:$HOME/.composer/vendor/bin
If you have a fresh installation, you may not have the PATH variable contains your home path. So, adding the $HOME variable would require like the following:
export PATH="$PATH:$HOME/.composer/vendor/bin
This command might solve your problem
test -d ~/.composer && bash ~/.composer/vendor/bin/valet install || bash ~/.config/composer/vendor/bin/valet install
In Ubuntu 18.04 do this:
echo "export PATH=$PATH:$HOME/.config/composer/vendor/bin" >> ~/.bashrc
source ~/.bashrc
with new composer installation, you need to add a new path which is
export PATH=$PATH:~/.config/composer/vendor/bin
Then you need to
chown YOUR_USERNAME ~/.config
for accessing composer packages without sudo command.
I have installed Composer version 2 and found that composer default path is ~/.config/composer/ and similarly valet is also installed on /.config/composer/vendor/bin/valet.
So to solve this issues I added the composer path to ~/.bashrc file as:
export PATH=$PATH:~/.config/composer/vendor/bin
Add ~/.composer/vendor/bin directory to your PATH variable.
For me worked
write in console
cd ~/.composer/vendor/bin
pwd
copy pwd command result
export PATH=$PATH: (pwd command result)
valet install
I think I explained well
I found a fix on this website, and it fixed my issue.
test -d ~/.composer && bash ~/.composer/vendor/bin/valet install || bash ~/.config/composer/vendor/bin/valet install
https://hidayatabisena.medium.com/solving-issues-command-not-found-laravel-valet-install-on-macos-mojave-2a7629759a9f
In my case I've to update /etc/profile file
added
export PATH=$PATH:~/.composer/vendor/bin
in
/etc/profile
then
source ~/etc/profile
In my case I found the valet location by manual search
Then add the the valet file path to PATH variable
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
Then I ran the install command and it worked
valet install
Php may be not installed
Use your prefered version with:
brew install php
// or
brew install php#8.0
// or
brew install php#7.4
This solved my issue.

sudo: port: command not found after updating .bash_profile

I am trying to install MacPorts on my OS 10.5.8. I followed the instructions for the installation of the MacPorts-2.1.3.tar.bz2 package, and after adding the following lines to my .bash_profile:
PATH=$PATH:opt/local/bin
export PATH
PATH=$PATH:opt/local/sbin
export PATH
I still got the following error when I tried to execute the the sudo port -v selfupdate command:
sudo: port: command not found
After investigating a similar post about the same error, I still am confused. Is it because I have my new path statements in the my .bash_profile and not in .profile or is it also because I forget the MANPATH environment variable?
Thanks for your help!
You are missing a leading backslash: /opt/local - not opt/local
The automated annotations from a MacPorts install always prepended the following directories for me: export PATH=/opt/local/bin:/opt/local/sbin:$PATH, in .profile.
i.e., the port binaries should take precedence over the system, or whatever else you have in your current PATH.

Resources