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.
Related
My main goal was to have syntax highlighting for nano.
Apparently my nano seems to be pico 5.09 instead of nano.
Running which nano, returns:
/usr/bin/nano
Then I tried to install the real nano with brew, there I get this error:
Warning: Treating nano as a formula. For the cask, use homebrew/cask/nano
Error: nano dependencies not built for the arm64 CPU architecture:
gettext was built for x86_64
I think brew looks like the legit arm version.
which brew
/opt/homebrew/bin/brew
What could I do to have the end result of
Nano with syntax highlighting?
If your brew dependencies are out of date, this could happen.
% brew update && brew upgrade && brew install nano
Already up-to-date.
...
% brew install nano
Warning: Treating nano as a formula. For the cask, use homebrew/cask/nano
==> Downloading https://ghcr.io/v2/homebrew/core/nano/manifests/6.4
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/nano/blobs/sha256:7206f1c20ac7f
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Pouring nano--6.4.arm64_monterey.bottle.tar.gz
==> nano cask is installed, skipping link.
🍺 /opt/homebrew/Cellar/nano/6.4: 103 files, 3.2MB
==> Running `brew cleanup nano`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
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
I'm trying to install wxWidgets on Mac OS X 10.9. It's already installed, but I'm having the problem described here. Someone suggested to add ENV.append_to_cflags "-stdlib=libc++". I did, but I'm not able to recompile the code.
$ brew install wxmac
Warning: wxmac-3.0.0 already installed
$ brew edit wxmac
=> ok, modifications done, now I want to recompile and reinstall
$ brew uninstall wxmac
Uninstalling /usr/local/Cellar/wxmac/3.0.0...
$ brew install wxmac
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/wxmac- 3.0.0.mavericks.bottle.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/wxmac-3.0.0.mavericks.bottle.2.tar.gz
==> Pouring wxmac-3.0.0.mavericks.bottle.2.tar.gz
🍺 /usr/local/Cellar/wxmac/3.0.0: 775 files, 41M
How can I force homebrew to recompile?
Homebrew is installing wxmac in bottle form (a pre-compiled binary of wxmac). To build from source, add the --build-from-source flag when calling brew install:
$ brew install --build-from-source wxmac
To rebuild all installed FORMULAE from source:
$ brew list | xargs brew reinstall --build-from-source
I'm trying to install glue 0.3 for OXS Mountain Lion and ran into this error after installing homebrew (Error: Cowardly refusing to sudo brew install You can use brew with sudo, but only if the brew executable is owned by root. However, this is both not recommended and completely unsupported so do so at your own risk.) I got this error after the first step for installing glue 0.3 ($ sudo brew install jpeg). No idea how to fix this...please help!
sudo chown root /usr/local/bin/brew
sudo chown -R $USER /usr/local
Use the above command instead of changing the owner of brew to root.
This is the suggested method by the Owner of homebrew in https://github.com/Homebrew/homebrew/issues/9953
Answered by the developers here:
https://github.com/Homebrew/homebrew/issues/9953
I solved it by NOT using sudo, and changing the permissions on whatever file it says cannot be accessed without sudo.
For example, I could not access /usr/local/Cellar, so I entered the following (as specified here: https://github.com/Homebrew/homebrew/issues/3930)
sudo chmod g+w /usr/local/Cellar
sudo chgrp staff /usr/local/Cellar
For High Sierra macOS 10.13.3 or newer.
None of the solutions given here worked for me on this version. The only (and the best) fix is to uninstall brew and install it again with the following terminal commands. Note you will lose your current kegs, so you should get a list of the installed kegs, for reinstalling them after reinstalling brew as shown below under step 1. Actually, this was a good opportunity for me to get rid of those kegs that I am no longer using:
List your current kegs for reinstalling, those you wan't to keep:
brew list
Uninstall brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Reinstall brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Optionally to prevent your usage being sent to Google Analytics (Update: Fortunately, now this has been stopped, so you may skip this step):
brew analytics off
Finally reinstall your previous kegs from step 1 (or those you still want to use). Replace the text with the square brackets with the list, (i.e. brew install sqlite heroku ):
brew install [list of kegs from step 1]
I have updated my macos to sierra and npm stopped working. Below are the steps followed to fix them.
Uninstall Node and install it from brew and follow the below steps
sudo chmod g+w /usr/local/Cellar
sudo chgrp staff /usr/local/Cellar
sudo chown root /usr/local/bin/brew
sudo brew postinstall node
This was helpful for me
http://digitizor.com/fix-cowardly-refusing-sudo-error-brew/
As quoted in the text, you essentially have to change the user and group of brew to root and wheel respectively.
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.