No such keg: /usr/local/Cellar/mongod I am trying to install MongoDB on Mac OSx El Capitan.
here is what the terminal gives me:

$ brew install mongodb --with-openssl
  ...
  Warning: mongodb-3.2.9 already installed, it's just not linked
  ...

$brew link mongod
Error: No such keg: /usr/local/Cellar/mongod

$ ls -l /usr/local/bin/mongod
lrwxr-xr-x  1 fred  admin  37 13 Sep 09:05 /usr/local/bin/mongod -&gt; ../Cellar/mongodb30/3.0.12/bin/mongod


Here is what I got during the mongod installation:

$ brew install mongodb --with-openssl
...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/bsondump
Target /usr/local/bin/bsondump
is a symlink belonging to mongodb30. You can unlink it:
  brew unlink mongodb30

To force the link and overwrite all conflicting files:
  brew link --overwrite mongodb

To list all files that would be deleted:
  brew link --overwrite --dry-run mongodb

Possible conflicting files are:
/usr/local/bin/bsondump -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/bsondump
/usr/local/bin/mongo -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongo
/usr/local/bin/mongod -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongod
/usr/local/bin/mongodump -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongodump
/usr/local/bin/mongoexport -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongoexport
/usr/local/bin/mongofiles -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongofiles
/usr/local/bin/mongoimport -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongoimport
/usr/local/bin/mongooplog -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongooplog
/usr/local/bin/mongoperf -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongoperf
/usr/local/bin/mongorestore -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongorestore
/usr/local/bin/mongos -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongos
/usr/local/bin/mongosniff -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongosniff
/usr/local/bin/mongostat -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongostat
/usr/local/bin/mongotop -&gt; /usr/local/Cellar/mongodb30/3.0.12/bin/mongotop
==&gt; Caveats
To have launchd start mongodb now and restart at login:
  brew services start mongodb
Or, if you don't want/need a background service you can just run:
  mongod --config /usr/local/etc/mongod.conf
==&gt; Summary
  /usr/local/Cellar/mongodb/3.2.9: 17 files, 241.2M


How do I make the link? Thanks
You have a typo in your command. You're typing:

brew link mongod


You should be typing:

brew link mongodb


Missing a d on the end there. The link command takes a keg name, not a file name.