In short, OS X does not have a package manager like apt-get. However, neat solutions exist, in form of Macports, Fink and Homebrew. As noted elsewhere, Fink is the older system that downloads binaries, while Macports installs and compiles everything natively on the machine on which you are installing something. To that end, Macports needs its own libraries, so it might download and keep its own version of Perl, Python and several other libraries on your system (typically under /opt/local/) – which as you might imagine can cause a lot of redundant stuff to be present on your system. Homebrew is the cleaner solution, in that it uses libraries that OS X already has installed – so it’s faster and doesn’t download the Internet on your computer if you want to install something.
The downside of Homebrew is that it does not have every package you might be interested in, while on the other hand Macports tends to have it all available, including modules for a particular language, e.g. pandas, IPython, numpy and scipy for Python.
I therefore tend to prefer Homebrew if a package is available under Homebrew, and fall back on to Macports for stuff it does not have. Which tends to be pretty often, and which also in turn brings us back to the issue that Macports, being all ‘self-reliant’ as it is, tends to keep a ton of files on your system.
It’s necessary as well as good practice to clean your system from time to time to remove packages that you no longer use, or packages or files that are intermediate or inactive on your system. I’m using material I found in one of the pages linked above, and have a simple script that does the cleaning for me when I want.
Last I checked, I gained almost 2GB of hard-disk real estate on my computer when I did the cleaning. Highly recommended!