vagrant, for example, requires root at the package level, and I haven’t figured out a way around this. I haven’t tried it though, and I’ve read it can cause problems for some packages. If you can’t run as root at all, you can try their untar anywhere method of installation. You should probably verify that the last line is still the recommended install method. With the current recommended install method, this would look like: sudo chgrp admin /usr/local /usr/local/bin This will require root, but you can then run the install script without needing to enter your root password. Assuming you are an administrator user, you can give the admin group ownership of directories, and then give the group write access to those directories. To make it not need to, you basically have to have permissions to write to the /usr/local and /usr/local/bin directories before running it. I didn’t want to give the install script root if I didn’t need to. Except when installing itself, which uses root to set some permissions. Anyway, homebrew installs packages as your user instead of the root permissions most package managers use. I use macports for most of my package management needs, but brew just has many packages macports doesn’t. I installed Homebrew, a Mac package manager, recently on my main computer. Because of this and changes to my general setup, I have a new Homebrew setup that uses Homebrew’s untar anywhere method. # No "brew update" until installing the proper openssl and a curl that uses it.The following method no longer seems to work due to changes in the install.sh script as well as locked down permissions in newer OS versions. #!/bin/bashĬurl -fsSLk | tar xz -strip 1 -C "$" According to a comment by this will take much longer because each package will be built from its source code. The brew system appears bootstrappable and can be installed in one own's home directory. git clone Įcho 'export PATH="/path/to/cloned_folder/homebrew/bin:$PATH"' > ~/.bash_profile This, in turn, is what allows you to install anything else without elevating credentials. In order to create /usr/local Homebrew needs temporary admin credentials to create the directory and assign ownership. The reason for this insistence is that /usr/local is precisely where POSIX recommends that stuff like this gets installed. Most if not all of these packages are pre-compiled and linked expecting to live in /usr/local. In fact, even if you forced it to install somewhere else, you are likely to break dependencies when you use brew install to install packages. The reason is that Homebrew strongly insists on installing packages into /usr/local. Make sure the bin directory, YOUR_HOME + /usr/local/bin is on your $PATH. bash_profile, I set (I'm not positive this is important, pretty sure): export HOMEBREW_PREFIX=/The/path/to/YOUR_HOME/usr/local Create the YOUR_HOME/usr/local directory. ĭownload that, set YOUR_HOME in the script to the absolute path. I modified the install script to not use sudo and to use a directory of your choice. More information about this alternative installation method (and source): Solution 2 Make sure that you add homebrew/bin to your $PATH. The above allows you to install homebrew anywhere. In case somebody is still looking for this in 2020 and beyond, yes, this is possible without root privileges: mkdir homebrew & curl -L | tar xz -strip 1 -C homebrew
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |