I know that the Mac commandline is very similar to that of Linux operating systems, so it would be nice to use some features of Linux in my Mac, specially installing Linux packages. For example, in Linux we can install a package by simply typing sudo apt-get install "package name" at the prompt. Is it possible to do something like this on Mac?


3 Answers 3


Yes, it is possible to install and run a variety of UNIX applications on OS X. There are a few solutions out there, my choice and recommendation is Homebrew. I've found other solutions to be overly complex and unwieldy.

  • in linux terminal installing command does any thing automatically it downloads files and ... how about Homebrew? is it required to download files manually?
    – peaceman
    Commented Jun 7, 2012 at 11:08
  • I'm sorry, I don't understand your question.
    – macaco
    Commented Jun 7, 2012 at 15:24
  • @peaceman once you've set up Homebrew, it downloads all the dependencies and files you need for any package you install from its repository. It's a beautiful thing, really.
    – Ian C.
    Commented Jun 7, 2012 at 16:09
  • 2
    @CajunLuke for one MacPorts will install duplicates of everything it needs. Don't want another bzip2? Too bad, you're getting one. Brew on the other hand leverages the existing system. I have 23 packages I like to install. With Macports that balloons with dependancies to 144 packages. With Homebrew, only 44. That's what I call "overly complex". You should seriously try Homebrew. You'll like it better.
    – bahamat
    Commented Jun 7, 2012 at 22:43
  • 2
    Like I said, you should seriously try it. It's easier to manage, it's easier to use, it's easier to fix and it's easier to contribute. I'm not trying to win. Just see for yourself, then pick the one you prefer.
    – bahamat
    Commented Jun 7, 2012 at 22:59

Yes, the open-source package ecosystem has expanded over the lifetime of macOS (neé Mac OS X). There are three main ones:

  • Homebrew is the most active and stable, and should be your first choice for common libraries and apps. (It's based on community-maintained recipes written in Ruby.)
  • MacPorts is a long-lived and also popular system. It tends support a greater variety of systems (old and new) as well as software versions. MacPorts recipes are written in Tcl.
  • Fink is one of the oldest mac package managers and tries to emulate apt-get. I don't know anyone personally who's used Fink in the last decade.

Finally, if you're looking for a more experimental and configurable package manager primarily aimed at developing scientific software, Spack is a great option. (Disclaimer: I'm a maintainer of the project.)

  • You can add pkgsrc and nix
    – mmmmmm
    Commented Aug 13, 2021 at 21:50
  • How is Homebrew more stable than macports?
    – mmmmmm
    Commented Aug 13, 2021 at 21:51
  • 1
    FWIW, I used Fink back when it was the only option; it worked OK for a while, but sometimes the dependencies would get tangled up; after one Mac OS X upgrade it got so bad I couldn't fix it, and ended up junking it.  More recently I've been using Homebrew, which has Just Worked with not the slightest trouble.
    – gidds
    Commented Aug 13, 2021 at 23:54
  • Are pkgsrc and nix also viable as mentioned in @mmmmmm 's comment?
    – Randall
    Commented Sep 1, 2022 at 14:21

Did you take a look at MacPorts?

You must log in to answer this question.

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