Main Tutorials

Where does Homebrew install packages on Mac?

By default, Homebrew will install all packages in the directory /usr/local/Cellar/, and also creates symbolic links at /usr/local/opt/ and /usr/local/bin/ (for executable files).

Terminal

/usr/local/Cellar/
/usr/local/opt/
/usr/local/bin/
Terminal

% brew -v
Homebrew 2.7.2
Homebrew/homebrew-core (git revision 3c379; last commit 2021-01-11)
Homebrew/homebrew-cask (git revision 40d45; last commit 2021-01-11)

P.S Tested with Homebrew 2.7.2 and macOS Big Sur 11.1

1. /usr/local/Cellar/

Directory listing for the /usr/local/Cellar/

Terminal

% ls -lsa /usr/local/Cellar/

total 0
0 drwxrwxr-x  62 mkyong  admin  1984 Jan 11 11:10 .
0 drwxr-xr-x  14 root         wheel   448 Dec 28 12:48 ..
0 -rw-r--r--   1 mkyong  admin     0 Jan 17  2020 .keepme
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 apr
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 apr-util
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 argon2
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 aspell
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 autoconf
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 brotli
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 c-ares
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 curl
0 lrwxr-xr-x   1 mkyong  admin     4 Dec  9 07:04 curl-openssl -> curl
0 drwxr-xr-x   3 mkyong  admin    96 Apr 16  2020 dart
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 freetds
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 freetype
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 gdbm
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 gettext
0 drwxr-xr-x   3 mkyong  staff    96 Apr 11  2020 glib
#...

2. /usr/local/opt/

Directory listing for the /usr/local/opt/

Terminal

% ls -lsa /usr/local/opt/

total 0
0 drwxrwxr-x  74 mkyong  admin  2368 Jan 11 11:10 .
0 drwxr-xr-x  14 root         wheel   448 Dec 28 12:48 ..
0 -rw-r--r--   1 mkyong  admin     0 Jan 17  2020 .keepme
0 lrwxr-xr-x   1 mkyong  admin    19 Apr 11  2020 apr -> ../Cellar/apr/1.7.0
0 lrwxr-xr-x   1 mkyong  admin    26 Apr 11  2020 apr-util -> ../Cellar/apr-util/1.6.1_3
0 lrwxr-xr-x   1 mkyong  admin    27 Apr 11  2020 argon2 -> ../Cellar/argon2/20190702_1
0 lrwxr-xr-x   1 mkyong  admin    23 Apr 11  2020 aspell -> ../Cellar/aspell/0.60.8
0 lrwxr-xr-x   1 mkyong  admin    23 Apr 11  2020 autoconf -> ../Cellar/autoconf/2.69
0 lrwxr-xr-x   1 mkyong  admin    23 Apr 11  2020 [email protected] -> ../Cellar/autoconf/2.69
0 lrwxr-xr-x   1 mkyong  admin    22 Apr 11  2020 brotli -> ../Cellar/brotli/1.0.7
0 lrwxr-xr-x   1 mkyong  admin    23 Apr 11  2020 c-ares -> ../Cellar/c-ares/1.16.0
0 lrwxr-xr-x   1 mkyong  admin    21 Dec  9 07:04 curl -> ../Cellar/curl/7.69.1
0 lrwxr-xr-x   1 mkyong  admin    21 Dec  9 07:04 curl-openssl -> ../Cellar/curl/7.69.1
0 lrwxr-xr-x   1 mkyong  admin    20 Apr 16  2020 dart -> ../Cellar/dart/2.7.2
0 lrwxr-xr-x   1 mkyong  admin    24 Apr 11  2020 freetds -> ../Cellar/freetds/1.1.26
0 lrwxr-xr-x   1 mkyong  admin    25 Apr 11  2020 freetype -> ../Cellar/freetype/2.10.1
0 lrwxr-xr-x   1 mkyong  admin    21 Apr 11  2020 gdbm -> ../Cellar/gdbm/1.18.1
0 lrwxr-xr-x   1 mkyong  admin    24 Apr 11  2020 gettext -> ../Cellar/gettext/0.20.1
0 lrwxr-xr-x   1 mkyong  admin    23 Apr 11  2020 glib -> ../Cellar/glib/2.64.1_1
#...

3. /usr/local/bin/

Directory listing for the /usr/local/bin/

Terminal

% ls -lsa /usr/local/bin/   
total 0
0 drwxrwxr-x  268 mkyong  admin  8576 Jan 11 11:10 .
0 drwxr-xr-x   14 root         wheel   448 Dec 28 12:48 ..
0 -rw-r--r--    1 mkyong  admin     0 Jan 17  2020 .keepme
0 lrwxr-xr-x    1 mkyong  admin    71 Apr 12  2020 apm -> /Applications/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm
0 lrwxr-xr-x    1 mkyong  admin    38 Apr 11  2020 argon2 -> ../Cellar/argon2/20190702_1/bin/argon2
0 lrwxr-xr-x    1 mkyong  admin    38 Apr 12  2020 aria_chk -> ../Cellar/mariadb/10.4.11/bin/aria_chk
0 lrwxr-xr-x    1 mkyong  admin    43 Apr 12  2020 aria_dump_log -> ../Cellar/mariadb/10.4.11/bin/aria_dump_log
0 lrwxr-xr-x    1 mkyong  admin    41 Apr 12  2020 aria_ftdump -> ../Cellar/mariadb/10.4.11/bin/aria_ftdump
0 lrwxr-xr-x    1 mkyong  admin    39 Apr 12  2020 aria_pack -> ../Cellar/mariadb/10.4.11/bin/aria_pack
0 lrwxr-xr-x    1 mkyong  admin    43 Apr 12  2020 aria_read_log -> ../Cellar/mariadb/10.4.11/bin/aria_read_log
0 lrwxr-xr-x    1 mkyong  admin    34 Apr 11  2020 aspell -> ../Cellar/aspell/0.60.8/bin/aspell
0 lrwxr-xr-x    1 mkyong  admin    41 Apr 11  2020 aspell-import -> ../Cellar/aspell/0.60.8/bin/aspell-import
0 lrwxr-xr-x    1 mkyong  admin    53 Apr 12  2020 atom -> /Applications/Atom.app/Contents/Resources/app/atom.sh
0 lrwxr-xr-x    1 mkyong  admin    36 Apr 11  2020 autoconf -> ../Cellar/autoconf/2.69/bin/autoconf
0 lrwxr-xr-x    1 mkyong  admin    38 Apr 11  2020 autoheader -> ../Cellar/autoconf/2.69/bin/autoheader
0 lrwxr-xr-x    1 mkyong  admin    36 Apr 11  2020 autom4te -> ../Cellar/autoconf/2.69/bin/autom4te
0 lrwxr-xr-x    1 mkyong  admin    38 Apr 11  2020 autoreconf -> ../Cellar/autoconf/2.69/bin/autoreconf
0 lrwxr-xr-x    1 mkyong  admin    36 Apr 11  2020 autoscan -> ../Cellar/autoconf/2.69/bin/autoscan
0 lrwxr-xr-x    1 mkyong  admin    38 Apr 11  2020 autoupdate -> ../Cellar/autoconf/2.69/bin/autoupdate
0 lrwxr-xr-x    1 mkyong  admin    28 Jan 17  2020 brew -> /usr/local/Homebrew/bin/brew
0 lrwxr-xr-x    1 mkyong  admin    33 Apr 11  2020 brotli -> ../Cellar/brotli/1.0.7/bin/brotli
0 lrwxr-xr-x    1 mkyong  admin    35 Apr 11  2020 bsqldb -> ../Cellar/freetds/1.1.26/bin/bsqldb
0 lrwxr-xr-x    1 mkyong  admin    37 Apr 11  2020 bsqlodbc -> ../Cellar/freetds/1.1.26/bin/bsqlodbc
0 lrwxr-xr-x    1 mkyong  admin    27 Apr 11  2020 cjpeg -> ../Cellar/jpeg/9d/bin/cjpeg
#...

4. brew info [package]

We can use brew info [package] to show detail about a specified installed package.

brew info nginx
For example, the below command shows the detail about the brew install nginx package.

Terminal

% brew info nginx      

nginx: stable 1.19.6 (bottled), HEAD
HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
https://nginx.org/
/usr/local/Cellar/nginx/1.17.9 (28 files, 2.1MB) *
  Poured from bottle on 2020-04-11 at 19:59:27
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/nginx.rb
License: BSD-2-Clause
==> Dependencies
Required: [email protected] ✘, pcre ✔
==> Options
--HEAD
	Install HEAD version
==> Caveats
Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To have launchd start nginx now and restart at login:
  brew services start nginx
Or, if you don't want/need a background service you can just run:
  nginx

brew info maven
Below is another example to show the detail about the brew install maven package.

Terminal

% brew info maven

maven: stable 3.6.3
Java-based project management
https://maven.apache.org/
Conflicts with:
  mvnvm (because also installs a 'mvn' executable)
/usr/local/Cellar/maven/3.6.3_1 (87 files, 10.7MB) *
  Built from source on 2021-01-11 at 11:10:48
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/maven.rb
License: Apache-2.0
==> Dependencies
Required: openjdk ✔

References

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
6 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Mike McNally
1 year ago

This is not correct for macOS Monterey 12.6. There is no /usr/local/Cellar after a brew installation.

Osama Albahrani
10 months ago
Reply to  Mike McNally

Are you using an M1/M2 mac?

Jswarrior
1 year ago
Reply to  Mike McNally

Ventura and I presume Monterey have /opt/homebrew/Cellar

steve
1 year ago
Reply to  Jswarrior

Agreed – this works on macOS Ventura – instead of what you have in (1) above:

ls -lsa /opt/homebrew/Cellar

Mohsen
4 months ago

it can also be installed in the following path: /opt/homebrew/Cellar/ in Homebrew 4.1.24