Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm having a problem of consistency between my machines because I have to explicitly specify the command path for some items like Image Magick. Port installs them to /opt/local/bin, but for consistency, I would like to install to /usr/local/bin. How can I specify that?

share|improve this question
    
Have you considered accepting an answer so the user receives points? –  Nerdling Oct 1 '09 at 19:06
add comment

migrated from stackoverflow.com Sep 15 '09 at 22:03

This question came from our site for professional and enthusiast programmers.

3 Answers

Just add /opt/local/bin to your path, like the rest of us. You can do this in ~/.profile

Trying to force it to /usr/local/bin

  • is an unnecessary effort
  • risks executable or library collisions with evil and a potentially disastrous impact
share|improve this answer
    
Like I said originally though I have to explicitly specify the command path in the application code. We have more than one development machines so some have installed from source (/usr/local/bin) and some have installed from Mac Ports (/opt/local/bin). –  Tom Sep 15 '09 at 19:09
2  
Either use MacPorts or don't: either way you should avoid using /usr –  Nerdling Oct 1 '09 at 18:58
1  
e.g. ln -s /opt/local/bin/convert /usr/local/bin/convert –  fideli Dec 12 '09 at 4:07
add comment

Macports really does not like being in /usr/local. From MacPorts Faq

/opt/local was chosen so as to avoid stomping on other various installations (e.g. fink uses /sw to do the same); /usr/local is not a viable choice for several reasons:

  1. Some software (especially auto* tools from Gnu) look in /usr/local as a default location, which means MacPorts can't be easily isolated when needed
  2. /usr/local is usually reserved for the given system's admin to install items local to that system, and tends to be a bad choice to have taken over by a non-system port system
  3. gcc considers /usr/local to be a standard system directory, causing (at least) the include directory to be unable to appear early in the list of include directories, and hence causing MacPorts-installed items to be difficult to use properly for items which need them (where another version is installed elsewhere, like /usr/X11R6)

Also if you have installs from different sources are you sure that they are exactly the same version. If they are not then you will have odd build and runtime issues.

If after all that you still want to try to us this unsupported method and you just cannot use the path to find things I suspect it would be easier to make your code look in /opt/local/bin then /us/local/bin then choose the one it finds (also what happens if both are there)

share|improve this answer
    
These reasons all seem to boil down to "you might want to use a different package system (or install from source) alongside MacPorts". It's a shame there's no supported solution for users who want to use MacPorts to manage all their packages and keep them in standard locations. –  Jesse McGrew Aug 19 '13 at 17:49
    
@JesseMcGrew What do you mean by standard location? Any directory can be used in Unix it just needs to be on the path. e.g. /opt is the standard Solaris location for third party installs –  Mark Aug 19 '13 at 18:14
    
I mean expected location, I guess. The presence of questions like this one and the MacPorts FAQ entry suggests that many users and software packages expect programs to be installed under /usr or /usr/local, and when MacPorts is the only package manager in use, it may be simpler to reconfigure MacPorts than to retrain/reconfigure everything else. –  Jesse McGrew Aug 19 '13 at 18:19
    
@JesseMcGrew you can set up Macports to use another directory but then up to you to debug :( I chose Macports BECAUSE it was in another directory after 10+ years of dealing with Unix and they made the same comments. –  Mark Aug 19 '13 at 18:53
add comment

If you know what you are doing, here is how to do it:

Installing Mac Ports from source.

share|improve this answer
1  
You should absolutely avoid using /usr as noted by Mark. –  Nerdling Oct 1 '09 at 18:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.