I installed apache-spark 1.6.1 lately and then I uninstalled it and update homebrew to install apache-spark 2.0.0. However, When I run brew doctor I don't get any helpful diagnostics about what is wrong:

Error: No such file or directory - /usr/local/Cellar/apache-spark/1.6.1

What should I do now? The version of my os is 10.11.6.


3 Answers 3


You have broken links. Homebrew has built in repair utility.
brew doctor

After brew finishes the doctor utility, run prune to update & fix homebrew's sym links.
brew prune

  • It doesn't work for me because the same warning shows immediately after these two command.
    – fois
    Sep 18, 2016 at 20:25
  • 5
    for future readers brew prune is by default disabled. Use brew cleanup instead
    – FutureCake
    Feb 5, 2019 at 21:34

That is as expected

You "I installed apache-spark 1.6.1 lately and then I uninstalled it" so uninstalled apache-spark 1.6.1 which deletes /usr/local/Cellar/apache-spark/1.6.1

Installing apache-spark 2.0.0. will install in /usr/local/Cellar/apache-spark/2.0.0

  • Maybe I didn't explain what the problem is. My problem is when I want to install some software else or use brew update or brew doctor, the same warning shows all the time.
    – fois
    Sep 18, 2016 at 20:27

You probably have the SPARK_HOME environment variable set to the wrong folder. You can check by running the following command in the shell:


If this outputs the '/usr/local/Cellar/apache-spark/1.6.1' folder, than that's your problem. To fix, just run the following command in terminal:

export SPARK_HOME="/usr/local/Cellar/apache-spark/2.0.1/libexec/"

or put it somewhere in your .bashrc file. (or whatever dotfile you use).

You must log in to answer this question.

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