Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install homebrew packages locally

Tags:

homebrew

admin

I got homebrew installed, however I do not have admin access. How do I install homebrew packages without admin access? Is there a local tag or something that I keep missing?

like image 642
Ford Smith Avatar asked Mar 03 '16 14:03

Ford Smith


3 Answers

Homebrew needs /usr/local to be chown-ed to your user, and you need sudo for that. If you can’t you have to install it elsewhere. Some people use ~/.brew or ~/homebrew; you can use anything but avoid paths with spaces. See the docs here.

Let’s say you want to install in ~/.brew; run the following command:

git clone --depth=1 https://github.com/Homebrew/brew ~/.brew

Then ensure the bin and sbin directories are in your PATH. If you’re using Bash add the following in your ~/.bash_profile:

export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"

Run source ~/.bash_profile or restart your shell and run brew doctor to see if it’s installed correctly. It should warn you it’s not installed into /usr/local but that’s expected here.

like image 140
bfontaine Avatar answered Sep 19 '22 01:09

bfontaine


To install homebrew without sudo.

git clone https://github.com/mxcl/homebrew.git
echo 'export PATH="/path/to/cloned_folder/homebrew/bin:$PATH"' >> ~/.bash_profile

Update the /path/to/cloned_folder with the path of the homebrew cloned folder.

Restart terminal and run

brew update
brew --version
like image 21
Astik Anand Avatar answered Sep 18 '22 01:09

Astik Anand


 git clone https://github.com/Homebrew/brew

 pwd

 echo 'export PATH="*RESULT_OF_PWD*/brew/bin:$PATH"' >> ~/.bash_profile
like image 27
Egor Ermolaev Avatar answered Sep 21 '22 01:09

Egor Ermolaev