sudo: port: command not found

chris (2008-03-08 11:54:51)
7306 views
2 replies
According to the macports installation docs, the installer will make the necessary changes to your bash profile to allow the shell to find the new port application once installed. I found this didn't happen when installing macports, so of course the environment couldn't find port:

secondhalf-lm:~ clacy$ sudo port -v selfupdate
sudo: port: command not found

It's easy to get around this just by extending the path in your .bash_profile - The following should do the job:

add the following to ~/.bash_history

export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info

and then re-source the file:

secondhalf-lm:~ clacy$ source .bash_profile 
secondhalf-lm:~ clacy$ sudo port -v selfupdate
Synchronizing local ports tree from rsync://rsync.macports.org/release/ports/
receiving file list ... file has vanished: "/ports/perl/p5-csp/.Portfile.sPwLRn" (in release)
done
.. etc

You now have a working ports installation.

christo
comment
Swami Atma
2008-09-18 18:13:21

Thank You



You now have a working ports installation.

christo


A big thank you.
reply iconedit reply
anonymous
2009-06-25 01:48:39

According to the macports installation docs, the installer will make the necessary changes to your bash profile to allow the shell to find the new port application once installed. I found this didn't happen when installing macports, so of course the environment couldn't find port:

secondhalf-lm:~ clacy$ sudo port -v selfupdate
sudo: port: command not found

It's easy to get around this just by extending the path in your .bash_profile - The following should do the job:

add the following to ~/.bash_history

export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info

and then re-source the file:

secondhalf-lm:~ clacy$ source .bash_profile 
secondhalf-lm:~ clacy$ sudo port -v selfupdate
Synchronizing local ports tree from rsync://rsync.macports.org/release/ports/
receiving file list ... file has vanished: "/ports/perl/p5-csp/.Portfile.sPwLRn" (in release)
done
.. etc

You now have a working ports installation.

christo


I did the above to the ~/.bash_profile file and it worked. ~/.bash_history is a hidden file in your user directory.
reply iconedit reply