Monday, March 05, 2007

sudo: port: command not found

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

Included the above lines in .bash_profile (my mac is using bash shell) and voila a nagging problem sudo: port: command not found is gone!!!

sudo port -d selfupdate

ran successfully. Now I was able to install FreeImage by running:
sudo port install freeimage

42 comments:

  1. Thank you for this. It was extremely helpful when trying to get my Mac set up with the tools that I need!

    ReplyDelete
  2. Hi there:
    here is my .bash_profile. I don't know why it can not work! Please give me some hits. Thanks!
    My main purpose is to use ImageMagick such as the guide as the website--http://www.imagemagick.org/script/binary-releases.php#macosx

    Michael
    changks@nrel.colostate.edu
    ===
    # Fri Sep 15 17:09:50 MDT 2006 - MODIS Reprojection Tool modifications
    PATH=$PATH:/Users/changks/MRT/bin:/Users/changks/Grads/bin:/usr/local/ferret/bin/ferret_paths_bash_template
    MRTDATADIR=/Users/changks/MRT/data
    export MRTDATADIR
    #export HOME=/Users/changks
    export BASH_ENV=$HOME/.bashrc
    export DISPLAY=129.82.99.149:0.0
    export PATH=$PATH:/opt/local/bin
    export MANPATH=$MANPATH:/opt/local/share/man
    export INFOPATH=$INFOPATH:/opt/local/share/info
    #/usr/bin/java -Dmrtdatadir=$/Users/changks/MRT/data -classpath$/Users/changks/MRT/bin/ModisTool.jar edu.sdsmt.modis.ModisTool
    #PATH=/usr/local/bin:$PATH
    #export PATH
    #-------------------------------
    # necessary path for executables
    #export
    # GrADS directory
    #export GASCRP=/Users/changks/gradsscripts
    export GADDIR=/Users/changks/Grads/data
    #export GAUDFT=/Users/changks/Grads/udf
    export GASCRP=/Users/changks/Grads/bin
    # NEdit text editor
    #export PATH=$PATH:/Users/changks/NEdit
    #unset USERNAME
    #test -r /sw/bin/init.sh && . /sw/bin/init.sh
    unset MAILCHECK
    #----------------------------------------------------------
    # Fri Sep 15 17:09:50 MDT 2006 - MODIS Reprojection Tool modifications
    bindkey -e
    alias vt100 "set term=vt100"

    if ( $?DISPLAY == 0 ) then
    setenv DISPLAY localhost:0
    endif

    set path = ( ~/bin $path /usr/local/bin .)

    senenv R_LIBS ${HOME}/Library/R/library:/sw/lib/R/library
    source /sw/bin/init.csh

    source /usr/local/ferret/bin/ferret_paths
    alias ferret 'ferret -nojnl'
    alias gvas 'gv --orientation=seascape --noantialias'
    alias gval 'gv --orientation=landscape --noantialias'
    alias gvl 'gv --orientation=landscape'

    alias top '/usr/bin/top -ocpu -R -F -s 2 -n30'

    setellipsis
    set prompt = '%{\e]0;%c3\007%}{\ek\e\\%}%S%D %w %T%s %U%m%u:%B%~%b%# '

    alias matlab '/Applications/MATLAB704/bin/matlab -nojvm -nosplash'

    set path = ( $path /Users/changks/MRT/bin )
    setenv MRTDATADIR /Users/changks/MRT/data
    source /usr/local/ferret/bin/ferret_paths
    setenv EDITOR 'edit -w'

    # Mon Feb 26 11:32:59 MST 2007 - MODIS Reprojection Tool modifications
    PATH=$PATH:/Users/changks/MRT/Modis/bin
    MRTDATADIR=/Users/changks/MRT/Modis/data
    export MRTDATADIR

    ReplyDelete
  3. worked fine for me. thanks :)

    ReplyDelete
  4. worked like a charm, wonderful thank you

    ReplyDelete
  5. Seems like this worked fine for most of you so i thought il try it.
    Unfortunaley i cant find my .bash_profile file.
    Where is it normally?

    ReplyDelete
  6. just try doing the following:

    vi .bash_profile


    then hit o to add a new line, paste the lines posted, hit esc to end editing and hold shift and hit zz to save. Then quit & restart your terminal and you should be golden.

    ReplyDelete
  7. Dan:
    thank you, you answered the question I had (where is the file) -- and how to modify it -- perfectly!

    ReplyDelete
  8. Anonymous12:27 AM

    thanks for this!

    ReplyDelete
  9. thanks a million! this fixed everything.

    ReplyDelete
  10. thanks dan! i was looking for this solution now quiet a time!

    ReplyDelete
  11. Hi, I was wondering if someone could help me- i have a macbook running leopard 10.5. I am new to macs but pretty experienced with unix/linux. The problem is that after making some changes to my .bashrc file my bash commands have stopped working. I cannot even use ls, cp, mv etc. Please can someone help

    ReplyDelete
  12. A bit late in the life of this thread but look for ~/.profile instead. I have 10.5.2 and it certainly has no .bash_profile but, like some other *nixes, uses .profile.

    ReplyDelete
  13. awesome. thank you.

    ReplyDelete
  14. cheers! thanks for the post! -kfjb

    ReplyDelete
  15. Thank you very much.

    ReplyDelete
  16. Thank you ever so much! I can run Thunderbird over ssh now!

    ReplyDelete
  17. I don't know if it fixed it for me, but t got rid of the message! (I think it all worked fine, but my command was bad, as I can now do sudo port, and it accepts that now) Thanks a bunch!!

    ReplyDelete
  18. hey, it's OK if i put down the lines on bash when i first opened up terminal and pressed enter for each line? i did not open up .bash_profile before i included the lines. yeah, i opened up .bash_profile later and included the lines, but i hope putting the lines straight after opening the terminal did not do anything.

    ReplyDelete
  19. Thank you for the post, it was driving me nuts.

    ReplyDelete
  20. Thank you very much. :)

    ReplyDelete
  21. Thank you. That worked for me, too! :)))

    ReplyDelete
  22. Just one more post of thanks--also thanks to dan for the helpful instructions for a neophyte.

    ReplyDelete
  23. Was of great help! Thanks for posting.

    ReplyDelete
  24. you saved me from a whole lot of frustration - thanks :)

    ReplyDelete
  25. following the rails install guide my .bash_login file looked like this:

    export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
    export MANPATH="/usr/local/man:$MANPATH"


    simply adding: export INFOPATH=$INFOPATH:/opt/local/share/info

    did not work, so i removed all of what i had cut n paste your lines and it installed. It worked however I am concerned about future conflicts. I will post your lines above my previous lines and see how that works out.

    Thanks for posting this.

    ReplyDelete
  26. This comment has been removed by the author.

    ReplyDelete
  27. Thanks a lot. Your suggestions really solved this problem.

    ReplyDelete
  28. so useful, thanks dan and all other posters

    ReplyDelete
  29. worked for me! thanks

    ReplyDelete
  30. Thank you very much!

    ReplyDelete
  31. Thank You!!!

    I spend my day on this, and now works!!!

    Best Regards from Brazil!!!

    ReplyDelete
  32. Thank you this was very helpful for me!!!

    ReplyDelete
  33. Thank you, thank you, thank you :) Worked perfectly and I didn't have to scroll through a million bits of bullsh*t to get the information I needed!

    Much appreciated!! :D

    ReplyDelete
  34. Can you close the comments on this blog entry?

    ReplyDelete
  35. Thanks a lot :)
    Always keep forgetting to push the path env variables into the bashrc/profile

    ReplyDelete
  36. Thanks for your post... :D

    Jefferson Fernandes, Brazil.

    04/07/2012

    ReplyDelete
  37. Thanks also. Worked for me with Lion.

    ReplyDelete
  38. Tuesday4:57 AM

    Thanks a lot man

    ReplyDelete
  39. Anonymous8:25 AM

    It didn't work for me.

    ReplyDelete