I was trying to brew update when I got suddenly a permission error:
/usr/local/bin/brew: line 28: /usr/local/Library/brew.rb: Permission denied
/usr/local/bin/brew: line 28: exec: /usr/local/Library/brew.rb: cannot execute: Undefined error: 0
I also tried sudo brew update, but without any luck.
What can I do?
The way that worked for me was to do as #happylookout suggested.
cd /usr/local
git fetch origin
git reset --hard origin/master
However, you may get a permissions error such as:
error: unable to unlink old 'bin/brew' (Permission denied)
error: unable to unlink old 'share/man/man1/brew.1' (Permission denied)
fatal: Could not reset index file to revision 'origin/master'.
To fix this, you need to run the last command above with sudo:
sudo git reset --hard origin/master
Now you should be able to run brew update without errors.
Had the same problem just now and solved it by updating the whole thing via git:
cd /usr/local
git fetch origin
git reset --hard origin/master
You could try running this
sudo chown -R $(whoami) /usr/local
I uninstalled brew and reinstalled it. Fixed the problem.
Related
I ran the following command to clone iHaskell repository:
git clone https://github.com/gibiansky/IHaskell
And then attempted to installl the kernel
ihaskell install --stack
Error:
zsh: permission denied: ihaskell
After running:
sudo ihaskell install --stack
I get:
sudo: ihaskell: command not found
So, how can I install iHaskell kernel on macOS Ventura ?
EDIT: After interchanging some comment with a user, I realised that I missed a step in my explanation.
I cloned the repository:
git clone https://github.com/gibiansky/IHaskell
I moved to that folder
cd IHaskell
and attempted
./ihaskell install --stack
Error:
zsh: no such file or directory: ./ihaskell
What am I missing ?
This question already exists:
home brew says no such file or directory [closed]
Closed 7 months ago.
I'm fairly new to bash's sudo commands etc. I recently wanted to upgrade my psql and when i tried to brew install it, it was not happening. Turns out that brew itself had stopped supporting my old version of mac os in 2021. Meaning I couldn't do anything with brew. Only first time when i ran brew update it gave me the following:
$brew update
warning: unable to unlink .gitignore: Permission denied
warning: unable to unlink .yardopts: Permission denied
warning: unable to unlink CODEOFCONDUCT.md: Permission denied
warning: unable to unlink CONTRIBUTING.md: Permission denied
warning: unable to unlink LICENSE.txt: Permission denied
warning: unable to unlink SUPPORTERS.md: Permission denied
error: unable to unlink old 'README.md' (Permission denied)
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
'brew update' , 'brew install' or 'brew doctor' - nothing worked. after that when ever i try, i get No such file or directory:
$brew install postgresql#12
-bash: /usr/local/bin/brew: No such file or directory
Wanted to know if bash has commands that can be used to upgrade my psql version? if yes, how?
To me it seems more like a permission problem, have you tried prepending sudo to brew update?
I had a laravel app on github and I want to clone on other computer .
After I cloned the repository and run composer install command it shows me this error:
[ErrorException]
copy(/Users/cosminciolacu/.composer/cache/files/symfony/debug/824e1c185cf2cd
10402999589458f4be7ef980e1.zip): failed to open stream: Permission denied
what I missed?
You may need to change the ownership and permissions of the directory you have installed the project in.
cd /path/to/project
sudo chmod -R 775 .
sudo chmod 660 .env
If the first answer did not work, do sudo composer install instead of composer install.
Warning: well, said in comment section.
I did brew update and got a error message
Your local changes to the following files would be overwritten by merge
I've searched previous posts for a workaround and I tried a host of suggested remedies but none worked. A problem is when I fired eg. git reset --hard FETCH_HEAD I got;
error: unable to unlink old 'README.md' (Operation not permitted)
fatal: Could not reset index file to revision 'FETCH_HEAD'.
I used sudo chmod and chown to change a file ownership and permission but I got the same error, "Operations not permitted".
here is an output of my brew --config;
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: f550366b94ab3022d325c9f5bcad496993d80c37
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit
ivybridge OS X: 10.9.3-x86_64
Xcode: 5.1.1 CLT: 5.1.0.0.1.1396320587
Clang: 5.1 build 503 X11: 2.7.5 => /opt/X11 System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/local/bin/python =>/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby
The brew doctor had warnings indicating my /usr/local is not writeable but I had not have any problem using brew until today.
Any help will be appreciated.
Try the following:
cd $(brew --prefix)
git fetch origin
git reset --hard origin/master
brew cleanup --force
brew update
It appears brew DOES have a recipe for hbase, but it fails with a 404 when downloading hbase itself.
13:44:51/java:11 $brew install hbase
==> Downloading http://www.apache.org/dyn/closer.cgi?path=hbase/hbase-0.94.11/hbase-0.94.11.tar.gz
==> Best Mirror http://apache.mirrors.tds.net/hbase/hbase-0.94.11/hbase-0.94.11.tar.gz
curl: (22) The requested URL returned error: 404 Not Found
Error: Download failed: http://www.apache.org/dyn/closer.cgi?path=hbase/hbase-0.94.11/hbase-0.94.11.tar.gz
A corrected url would be: http://mirror.reverse.net/pub/apache/hbase/hbase-0.94.11/hbase-0.94.11.tar.gz
I am not experienced in creating/modifying brew recipes. Would this be a simple case of downloading/tweaking a brew recipe file for a correct hbase download url and then re-trying? What would be the steps?
Update
Based on comments below i did
$brew update && brew upgrade
This failed for me:
error: Your local changes to the following files would be overwritten by merge:
Library/Contributions/brew_bash_completion.sh
Library/Contributions/brew_fish_completion.fish
Library/Contributions/brew_zsh_completion.zsh
Library/Contributions/cmd/brew-dirty.rb
Library/Contributions/cmd/brew-leaves.rb
..
Library/Formula/chruby.rb
Library/Formula/cimg.
error: The following untracked working tree files would be overwritten by merge:
Library/Aliases/git-tig
Library/Aliases/libtcnative
Library/Contributions/cmd/brew-bundle.rb
..
Library/Formula/vtclock.rb
Library/Formula/x11vnc.rb
Library/Formula/x265.rb
Library/F
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
Worked for me as well:
[ ~] brew install hbase
==> Installing hbase dependency: hadoop
==> Downloading http://www.apache.org/dyn/closer.cgi?path=hadoop/core/hadoop-1.2
==> Best Mirror http://www.dsgnwrld.com/am/hadoop/core/hadoop-1.2.1/hadoop-1.2.1
############
After searching for how to fix brew update && brew upgrade , then following some instructions on Brew update failed: untracked working tree files would be overwritten by merge and doing some manual updating of permissions under /usr/local, I was able to install hbase.
The following solved my problem, the code simply gets latest references from git
cd /usr/local && git reset --hard FETCH_HEAD
or if it fails
cd /usr/local && sudo git reset --hard FETCH_HEAD