I'm attempting to install HomeBrew on OS X 10.12.6. When I use the autoinstall script from Homebrew's website:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Everything runs smoothly until it begins actually downloading and installing Homebrew, at which point it returns the following error:
==> Downloading and installing Homebrew...
/usr/local/homebrew/.git: Permission denied
Failed during: git init -q
Any tips of how to resolve this? Any assistance would be greatly appreciated!
You should make your /usr/local/bin and /usr/local/opt writeable, i.e.:
chmod +w /usr/local/bin
chmod +w /usr/local/opt
Depending on your user's permissions you may have to use sudo to achieve it.
Maybe git is missing:
apt install git
Related
I have to install redis, but it is not working to install redis anymore using brew. Getting the following error when trying to install this way:
Warning: No available formula with the name "redis".
==> Searching for similarly named formulae and casks...
==> Casks
another-redis-desktop-manager ✔ redis-pro
jpadilla-redis redisinsight
medis
To install another-redis-desktop-manager ✔, run:
brew install --cask another-redis-desktop-manager ✔
Tried the command brew install --cask another-redis-desktop-manager.
This also didn't work.
Actually found the answer. Basically the reason for the failure in installation was because the core homebrew packages were not correctly configured.
Identified the issue with brew doctor
The solution was
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
ARM Homebrew must be installed in the /opt/homebrew directory. Earlier, you need to manually create directories and run commands. However, you do not need to manually run commands to use the latest scripts.
Direct execution:
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
PS: terminal type Run the echo $SHELL command. The command output is as follows:
/bin/bash => bash => .bash_profile
/bin/zsh => zsh => .zprofile
If you encounter invalid environment variables, you are advised to check the terminal type before setting the correct environment variables.
Starting with macOS Catalina(10.15.x), Macs use zsh as the default Shell, using.zprofile, so the corresponding command:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
If you have macOS Mojave or later and have not configured zsh yourself, use.bash_profile:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile
eval "$(/opt/homebrew/bin/brew shellenv)"
Hope this can help you
I installed homebrew on ubuntu 19.04 and it's accidentally stop, so the install not complete. but the folder already created.
If I install it again
sudo apt install linuxbrew-wrapper
I get a message:
linuxbrew-wrapper is already the newest version
but if I write command :
brew upgrade
I get this message:
Command 'brew' not found, but can be installed with:
sudo apt install linuxbrew-wrapper".
Can anyone help me fix this?
Maybe this can help more people...
I just executed the following command line
$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
This is the same url as in here Homebrew homepage but instead of install.sh, I used uninstall.sh.
After performing what https://stackoverflow.com/a/57208010/2787992 said, you might need to run
sudo rm -rf /home/linuxbrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
sudo rm -rf /home/linuxbrew
For details see: https://www.how2shout.com/linux/how-to-install-brew-ubuntu-20-04-lts-linux/
Try uninstalling the packages.
To remove just linuxbrew-wrapper package
sudo apt-get remove linuxbrew-wrapper
If you want to delete configuration and data files
sudo apt-get purge linuxbrew-wrapper
Source your bashrc first
source ~/.bashrc
I am trying to install do brew install python3 on my mac but i keep getting the following errors:
this is the first error:
No such file or directory # dir_chdir - /usr/local/Cellar
then a bit later i get this error:
An exception occurred within a child process:
Errno::EPERM: Operation not permitted # dir_s_mkdir - /usr/local/Cellar
I have ran brew update then brew doctor the brew cleanup but keep getting the error.
I have also checked to see if xcode is up-to-date but according to the appstore all my apps are up-to-date.
How do i fix this problem?
PS i also get these errors when trying to install other packages from brew.
Try uninstalling Homebrew and then re-installing solved issue for me.
Uninstall Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Re-install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Performed in MacOS Mojave (10.14.4)
Happened to me when uninstalling Laravel Valet.
Fixed by running: brew doctor, then brew cleanup after.
After that - brew install php worked just fine.
I experienced a similar error with a different package - brew install llvm.
Uninstalling homebrew and reinstalling led to more catastrophic issues that lasted for hours before I had to reach for my backup drive and restore everything.
What eventually worked was just creating the missing directory and everything worked.
So in this case:
sudo mkdir /usr/local/Cellar/dir_chdir
should solve the issue without too much hustle.
It worked for me after running below commands
sudo mkdir /usr/local/Cellar/dir_chdir
sudo chown -R $(whoami) /usr/local/Cellar
chmod u+w /usr/local/Cellar
I had this problem as well - it was partly coming from brew being installed under a different user on my mac I had set up for a past project. I had to follow the uninstall instructions (found in the homebrew github) with a little bit of sudo help and it cleared up the issue. Was able to install and properly run packages after.
For ubuntu just go to the location which u are getting error. Then open the contained file using a suitable application. In my case, it is getting as follows in the image view.
In this case, the error is showing in 36's lines.
yes. There is no location such as. I have to find out the location which contains brew. It was in /home/linuxbrew/.linuxbrew//bin/brew shellenv
So update your .profile file as in the brew file contains location as follows image shown.
uninstall brew :
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
and again reinstall brew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
executed this same as it is on your terminal, it will really work.
When I try to "brew link autoconf" in the terminal I keep getting this error.
Error: Could not symlink file: /usr/local/Cellar/autoconf/2.69/share/emacs/site-lisp
/usr/local/share/emacs is not writable. You should change its permissions.
Anyone have any ideas on how to fix this? Thanks!
You need to make sure that all the files and folders in /usr/local are writable by you. You can do this by typing the following command
chown -R yourusername /usr/local
chmod -R u+w /usr/local
You may have to use sudo for those commands to work.
After you do this, try linking again.
(sudo) chown -R yourusername /usr/local
I had to run
chmod -R u+w /usr/local
brew link --overwrite autoconf
brew install htop
I tried under /usr/local/share/emacs/
sudo chmod 777 site-lisp
and then
brew link autoconf
and problem solve!
mac#Anna_mac : /usr/local/share/emacs : brew link autoconf
Linking /usr/local/Cellar/autoconf/2.69... 22 symlinks created
I had to run the following commands
chown -R yourusername /usr/local
chmod -R u+w /usr/local
brew link --overwrite autoconf
You just need to change brew owned by root.
then you can use below command.
sudo brew link xxxx
Quote from github, this is not a bug, it is designed:
jacknagel commented on 4 Feb 2012
brew install will not work with root privileges unless brew itself is
owned by root. #jacknagel Collaborator jacknagel commented on 4 Feb
2012
(this is by design.)
I'm on OSX and want to switch back to my original zsh config from oh-my-zsh, however when I run the uninstall script it gives me an error:
$ sudo uninstall oh-my-zsh
>> Preparing Uninstall...
Uninstall Began...
Uninstall Failed...
Reason: ErrorMissingBundle
Can anyone please tell me what this means? Thanks!
Have you tried just running the commands from uninstall script by hand? It's really straight forward: https://github.com/robbyrussell/oh-my-zsh/blob/master/tools/uninstall.sh. For the most part it just removes OMZ and attempts to restore a back up file:
rm -rf ~/.oh-my-zsh
rm ~/.zshrc
cp ~/.zshrc.pre-oh-my-zsh ~/.zshrc
source ~/.zshrc
In new version, just run uninstall_oh_my_zsh from the command-line.
See https://github.com/robbyrussell/oh-my-zsh#uninstalling-oh-my-zsh
Try
/usr/bin/chsh -s /bin/bash
rm ~/.zshrc
brew uninstall zsh --force
just run uninstall_oh_my_zsh
from here
https://github.com/robbyrussell/oh-my-zsh#uninstalling-oh-my-zsh
I was unable to uninstall directly since I was getting zsh:command rm not found
so I did the following:
/usr/bin/chsh -s /bin/bash
on terminal preference, I switched back to the default Login shell
and ran the below command
rm ~/.zshrc
brew uninstall zsh --force
simply use the following command:
/usr/bin/chsh -s /bin/bash