Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "brew link" do?

Tags:

homebrew

When I run brew doctor I get the common warning:

Warning: You have unlinked kegs in your Cellar Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: # [...] 

What does it mean for kegs to be unlinked? And what does brew link do exactly?

like image 724
mbaytas Avatar asked Oct 21 '15 20:10

mbaytas


People also ask

What does brew link node do?

brew link creates symlinks to installations you performed manually in Cellar . This allows you to have the flexibility to install things on your own but still have those participate as dependencies in homebrew formulas.

What does brew switch do?

What Is Switch Homebrew? Switch Homebrew or simply homebrew is a software or app that isn't authorized by Nintendo. It is similar to the jailbreaking process of the Apple ecosystem. Homebrew includes emulators, games, editing apps, tools, custom firmware, and other applications.

What does keg only mean it was not Symlinked?

The packages for which the symlinking step is skipped are called keg-only. If you want to override Homebrew's decision not to symlink a package into /usr/local , you can modify your PATH variable as in the suggestion from brew that you've posted.


2 Answers

brew link creates symlinks to installations you performed manually in Cellar. This allows you to have the flexibility to install things on your own but still have those participate as dependencies in homebrew formulas.

See the FAQ for more information.

You should follow those instructions and run brew link on the entries it lists.

like image 154
leeor Avatar answered Oct 04 '22 17:10

leeor


Homebrew can allow multiple versions of a formula to be installed. For example, there is formulae called node and node@10 and similar.

$ brew info node@10 ... ==> Caveats node@10 is keg-only, which means it was not symlinked into /usr/local, because this is an alternate version of another formula. 

If I have both node and node@10 installed, where node is at v11. I can decide later to active the earlier version with brew link:

$ brew unlink node  $ brew link node@10  $ cd /urs/local/bin $ ls -l node lrwxr-xr-x  1 user  admin  34 12 Dec 20:07 node -> ../Cellar/node@10/10.14.1/bin/node 

Here the symlink node is pointing to an earlier version (keg-only) installed in Cellar.

like image 39
themefield Avatar answered Oct 04 '22 17:10

themefield