Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At the moment i am running git, perl 5.12.3 as well as python 2.7.1 on osx 10.7.3, which were all included in the basic system setup. Applying the "which" command the locations are:


I wanted to keep those versions untouched and upgrade and install the latest ones aside. If they are installed within '/usr/local/bin' and inside of '.bash_profile' '/usr/local/bin' is placed at the first position of 'export PATH=' and you are applying 'which' afterwards the location would be:


Now the question is which version of git, perl and or python osx would be using. Basically i guess it would use the versions from '/usr/local/bin' too? Or are the absolute paths of '/usr/bin' been hardcoded within the parts of osx and xcode requiring them? Thanks r.

share|improve this question

migrated from Apr 24 '12 at 7:06

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

For Perl, you might want to look into perlbrew. – ikegami Apr 24 '12 at 0:20
For git, grab the source code of it and compile it with your desired --prefix. Also, MacPorts installs softwares under /opt/, it will not touch those that come with your system installation. I don't like MacPorts cause it's quite slow compared to HomeBrew. – Neevek Apr 24 '12 at 1:06
up vote 1 down vote accepted

Yes, you can install your own versions of the programs in /usr/local/bin or any other directory of your choosing that you place on your PATH ahead of /usr/bin etc. I do this all the time for both Perl and Git; I don't use Python so much.

The scripts that are distributed by Apple will likely continue to use the system-provided tools. Indeed, the reason I install my own Perl is so that regardless of what I do in the way of installing extra modules, I won't be breaking anything the system uses (probably). I've never run into problems, at any rate. My programs use my versions; other people's programs configure themselves to use whatever they see fit; the system continues to work.

share|improve this answer
Yup. This is also MacPorts' default installation path. – Johnsyweb Apr 24 '12 at 6:35

I would recommend to use homebrew.

You can install git and python and probably also perl with it. For perl I use perlbrew with which you can have multiple versions of perl concurrent, but for one (the latest) version, homebrew should also work here.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .