I'm trying to install watchman via Homebrew.
When it's trying to install one of its dependencies, I get this error:
==> Installing watchman dependency: python#2
==> Downloading https://homebrew.bintray.com/bottles/python#2-2.7.14_3.high_sierra.bottle.2
######################################################################## 100.0%
==> Pouring python#2-2.7.14_3.high_sierra.bottle.2.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied # dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied # dir_s_mkdir - /usr/local/Frameworks
Running brew doctor gives me:
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:
python#2
gnupg
Warning: Broken symlinks were found. Remove them with `brew prune`:
/usr/local/bin/electron
When I try brew link --overwrite python#2 I get:
Linking /usr/local/Cellar/python#2/2.7.14_3... Error: Permission denied # dir_s_mkdir - /usr/local/Frameworks
And when I try brew remove python#2 I get:
Error: Refusing to uninstall /usr/local/Cellar/python#2/2.7.14_3
because it is required by mongodb, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies python#2
I'm a bit lost here as I have little to no experience using brew. I just want to get watchman installed!
Seems like brew was trying to link python#2 but couldn't because it couldn't make the folder /usr/local/Frameworks.
This was solved with the following steps:
sudo mkdir -p /usr/local/Frameworks
sudo chown -R $(whoami) /usr/local/*
brew link python#2
Related
I am stuck when trying to install "openconnect" using homebrew because I am not permitted to make the symbolic link to /usr/local/share/locale/ca/LC_MESSAGES.
I am running Big Sur version 11.4.
Below follows what I have tried:
(base) MacBook-Pro-5:Data Eigil$ brew uninstall --force openconnect
Uninstalling openconnect... (54 files, 2.8MB)
(base) MacBook-Pro-5:Data Eigil$ brew cleanup -s openconnect
Removing: /Users/Eigil/Library/Caches/Homebrew/openconnect--8.10... (971.3KB)
(base) MacBook-Pro-5:Data Eigil$ brew cleanup --prune-prefix
(base) MacBook-Pro-5:Data Eigil$ brew install openconnect
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Formulae
Updated 8 formulae.
==> Updated Casks
Updated 1 cask.
==> Downloading https://ghcr.io/v2/homebrew/core/openconnect/manifests/8.10
Already downloaded: /Users/Eigil/Library/Caches/Homebrew/downloads/c979ec1baea5847f748962ba42b95bce88cef90599731a131c5588090c9c066b--openconnect-8.10.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/openconnect/blobs/sha256:9755c4ea66ed9c8aa1f1ee966c932ec2be37849887636d8f65a920f20c16ec55
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:9755c4ea66ed9c8aa1f1ee966c932ec2be37849887636d8f65a920f20c16ec55?
######################################################################## 100.0%
==> Pouring openconnect--8.10.big_sur.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/locale/ca/LC_MESSAGES/openconnect.mo
/usr/local/share/locale/ca/LC_MESSAGES is not writable.
You can try again using:
brew link openconnect
==> Summary
🍺 /usr/local/Cellar/openconnect/8.10: 54 files, 2.8MB
The suggested solution doesn't work (still because I cannot write to LC_MESSAGES). sudo is not permitted on that directory neither.
ls -l /usr/local/share/locale/ca/
gives:
total 0
drwxr-xr-x 3 root wheel 96 Jun 28 11:34 LC_MESSAGES/
Any help would be appreciated.
Homebrew is not designed to work with sudo. You should never prepend sudo before command brew, which will change the ownership of some of the brew related files.
The consequence is that some of the files are not owned by you but by root now. You have to fix the permission.
# For x86 Mac
sudo chown -R "$(whoami):admin" /usr/local/*
# For M1 mac
sudo chown -R "$(whoami):admin" /opt/homebrew/*
# NOTE:
# * in /usr/local/* is used on purpose to only match the sub folders, files
# The command will take some time, wait patiently.
You'd better re-install openconnect after above fix.
I am seeing on my mac the the following weird situation
$ brew search go#1.13
==> Formulae
go#1.13
and
$ brew install go#1.13
Error: go#1.13: unknown keyword: because
Also the error message is weird (it doesn't seem to complete the sentence.) I can brew install go#1.14 without any problem.
Please help provide some clues. Thank you.
That looks like your brew is not up to date. Can you run brew update to ensure everything is up to date before running brew install go#1.13? That would probably solve your issue.
Here is my installation test:
$ brew install go#1.13
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 15 formulae.
Warning: go#1.13 has been deprecated because it is not supported upstream!
==> Downloading https://homebrew.bintray.com/bottles/go%401.13-1.13.15.mojave.bottle.1.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/d994ff2b27c191bb74dd44a373e254ef92472c1cb13e381cf6bf9d3d118
######################################################################## 100.0%
==> Pouring go#1.13-1.13.15.mojave.bottle.1.tar.gz
==> Caveats
go#1.13 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have go#1.13 first in your PATH run:
echo 'export PATH="/usr/local/opt/go#1.13/bin:$PATH"' >> /Users/rchen/.bash_profile
==> Summary
🍺 /usr/local/Cellar/go#1.13/1.13.15: 9,282 files, 414.5MB
Trying to install brew-cask after tapping caskroom/cask,
brew tap caskroom/cask
brew install brew-cask
But getting error,
$ brew install brew-cask
Updating Homebrew...
Error: No available formula with the name "brew-cask"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
This similarly named formula was found:
brew-cask-completion ✔
To install it, run:
brew install brew-cask-completion ✔
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
Tried brew cleanup, untapped caskroom/cask and reinstallation of brew-cask but no luck.
I installed, brew-cask-completion using brew install brew-cask-completion. And read somewhere brew-cask is deprecated. So what is the solution. I ignored it and installed the java open sdk. My question is, is it going to be a problem in future if I don't install it?
Thanks in advance!
It happens because of corrupted core installation, actually you will give this error for installing any packages, you should fix the with:
rm -fr $(brew --repo homebrew/core)
Then install what ever you want, for me:
brew intall deno
Try reinstalling it with these commands in this order:
brew uninstall brew-cask
brew untap caskroom/cask
brew tap caskroom/cask
brew install brew-cask
After
brew install libmpc
I got an error
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link libmpc'
Then I run
brew doctor
and I got
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: `libmpc`
So I run
brew link libmpc
and I got
Error: Could not symlink file: /usr/local/Cellar/libmpc/1.0.1/lib/libmpc.dylib
/usr/local/lib/libmpc.dylib may already exist.
/usr/local/lib may not be writable.
What should I do?
Try to clean up old homebrew files:
brew cleanup
I am attempting to install nginx using the brew package manager, but it fails to link. How can I fix this?
roc-web5537:Downloads cmuench$ brew install nginx
Warning: Your Xcode (4.3.3) is outdated
Please install Xcode 4.5.
==> Installing nginx dependency: pcre
==> Downloading ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.bz2
Already downloaded: /Library/Caches/Homebrew/pcre-8.31.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/pcre/8.31 --enable-utf8 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2
==> make test
==> make install
Warning: Could not link pcre. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link pcre'
==> Summary
/usr/local/Cellar/pcre/8.31: 130 files, 3.2M, built in 18 seconds
==> Installing nginx
==> Downloading http://nginx.org/download/nginx-1.2.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/nginx-1.2.4.tar.gz
==> Patching
patching file conf/nginx.conf
==> ./configure --prefix=/usr/local/Cellar/nginx/1.2.4 --with-http_ssl_module --with-pcre --with-ipv6 --with-cc-opt=-I/usr/local/include --with-ld-opt=-L/usr/local/lib --conf-path=/usr/loca
==> make
==> make install
==> Caveats
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.
If you want to host pages on your local machine to the public, you should
change that to localhost:80, and run `sudo nginx`. You'll need to turn off
any other web servers running port 80, of course.
You can start nginx automatically on login running as your user with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/nginx/1.2.4/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
Though note that if running as your user, the launch agent will fail if you
try to use a port below 1024 (such as http's default of 80.)
Warning: Could not link nginx. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link nginx'
Warning: /usr/local/sbin is not in your PATH
You can amend this by altering your ~/.bashrc file
==> Summary
/usr/local/Cellar/nginx/1.2.4: 9 files, 952K, built in 9 seconds
I had this issue a few days ago with installation of Yeoman. It seems that some of the folders in /usr/local might not be owned by you and that can cause issues. In my case I had a couple of folders in /usr/local/ like that.
Go to /usr/local
cd /usr/local
Check who owns the folders
ls -l
Do the following for folders not owned by you (replacing sub-foldername with sub folders name obviously):
sudo chown $(whoami) /usr/local/<sub-foldername>
and then call
brew link pcre
It should link successfully.
Hope this helps.
This can sometimes happen if there area already files (or symlinks) with the same name. To force a link, you can use brew link -f pcre. If you want to see whether there are any files preventing the link, you can use brew link --dry-run pcre.
If there are no files listed by brew link --dry-run pcre, then it is likely that jwwishart's answer is the correct one.
I had to remove manually and reinstall pcre and openssl then nginx will work:
brew remove pcre
brew remove openssl
brew install pcre
brew install openssl
nginx
Was getting
erma4inapower#MacBook-Pro-Dmitrij ~ brew services start php
Error: Permission denied # rb_sysopen - /Users/erma4inapower/Library/LaunchAgents/homebrew.mxcl.php.plist
Ended up:
sudo chown -R $(whoami) /Users/erma4inapower/Library/LaunchAgents/
I had the same issue and was causing problems while other services using brew.
how to fix run
brew doctor
remove all files which are causing the issue. might have to do
rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
if warning comes up
make sure you are in master branch by
git -C $(brew --repo homebrew/core)
checkout Important is the brew doctor command which help me fix the issue.