OsX is like Windows, in that it doesn't have package manager like what you get with a Gnu/Linux distribution. You can use macports and what you desire is most likely FINK.
The repositories maintained for these programs are not by apple, so you are relying on a third party which is not a great practice.
The alternative as Celyr pointed out is to install a Gnu/Linux distribution onto your mac. I personally much prefer most Gnu/Linux distributions over OsX, but when i bought my first computer, i'd never used Linux at the time and chose a macbook pro. Since then however i have, and consequently i have installed Gnu/Linux to my Macbook pro. The problem with this approach is that OsX is created specifically with certain hardware in mind. Because of this factor, i've found a major drain on the battery while using Gnu/Linux. You just have to google 'Bootcamp battery life' to get an idea that many many others are suffering the same issue running Windows.