Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew) - homebrew

I tried to upgrade with Brew
$ brew upgrade stripe/stripe-cli/stripe
I got:
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.
AS suggested, I tried
$ arch -arm64 brew install
But got:
Error: Invalid usage: This command requires at least 1 formula or cask argument.
I tried installing Rosetta 2 according to this tutorial
$ /usr/sbin/softwareupdate --install-rosetta --agree-to-license
But I got:
Installing Rosetta 2 on this system is not supported.

Seems homebrew has to be used like this from now on:
arch -arm64 brew upgrade

I added the original argument to arch -arm64 brew upgrade and it worked
$ arch -arm64 brew upgrade stripe/stripe-cli/stripe

Well, all other answers seemed like a workaround for me, I would recommend to do this
cd /opt
sudo mkdir homebrew
sudo chown $(whoami):admin homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
Then just reload terminal and your brew install xxx should work just fine.

Related

Can't install cocoapods on macOS Big Sur

I am using MacOS Big Sur 11.0 Beta.
I tried to install cocoapods but I can't.
First, I tried with;
sudo gem install cocoapods
It says
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
Then, I tried with;
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew cleanup -d -v
brew install cocoapods --build-from-source (also tried with "brew install cocoapods")
It says
Error: pkg-config: no bottle available!
You can try to install from source with:
brew install --build-from-source pkg-config
So, I tried brew install --build-from-source pkg-config, and it says Error: macOS '10.16' is invalid.
Anybody can help me?

dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib

Using electron-builder to build Windows app, When signing up, I got this error :
dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
Referenced from: /Users/puss/Library/Caches/electron-builder/winCodeSign/winCodeSign-1.7.0/darwin/osslsigncode
Reason: image not found
If you are in MacOS 10.15 (Catalina), try this (reinstall openssl):
brew update && brew upgrade
brew uninstall openssl
brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
I try to uninstall openssl and reinstall openssl, It worked.
brew remove openssl
brew install openssl
Just switch to 1.0.2t version, using this command:
brew switch openssl 1.0.2t
For me, re-installing openssh (not openssl) was the only solution.
brew remove openssh
brew install openssh
Thanks unifreak, I fixed this problem on macOS v10.11.6 at Tue Apr 28 2020 again.
REF: https://stackoverflow.com/a/59224109/686105
Update homebrew index and upgrade. (option)
[ chusiang#osx_el_capitan ~ ]
$ brew update && brew upgrade
Try to remove the openssl#1.1.
[ chusiang#osx_el_capitan ~ ]
$ brew uninstall openssl#1.1
Error: Refusing to uninstall /usr/local/Cellar/openssl#1.1/1.1.1g
because it is required by ansible-lint, atk, cairo, gdk-pixbuf, glib, gnupg, gnutls, gobject-introspection, gsettings-desktop-schemas, gtk+3, gtk-doc, harfbuzz, ipmitool, ipython, irssi, itstool, krb5, libevent, libfido2, libpq, libssh, libssh2, libxml2, macvim, meson, nmap, openssh, pango, pgcli, postgresql, python, python#2, python#3.8, ruby, rust, s3cmd, sdcv, sphinx-doc, sshuttle, tcpdump, tmate, tmux, travis, unbound, vim, w3m, wget and zenity, which are currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies openssl#1.1
Remove the openssl#1.1 with --ignore-dependencies args.
[ chusiang#osx_el_capitan ~ ]
$ brew uninstall --ignore-dependencies openssl#1.1
Uninstalling /usr/local/Cellar/openssl#1.1/1.1.1g... (8,052 files, 18.4MB)
Install the specific version of openssl v1.0.0.
[ chusiang#osx_el_capitan ~ ]
$ brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
Lock the openssl version with v1.0.0.
[ chusiang#osx_el_capitan ~ ]
$ brew pin https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
Add this openssl into $PATH.
[ chusiang#osx_el_capitan ~ ]
$ echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
Apply this change of $PATH.
[ chusiang#osx_el_capitan ~ ]
$ source ~/.bash_profile
DONE.
[ chusiang#osx_el_capitan ~ ]
$ openssl version
OpenSSL 1.0.2t 10 Sep 2019
Finally, the ssh / git / ansible were back !
Here's what worked for me
brew update && brew upgrade
brew uninstall --ignore-dependencies openssl
brew install openssl
I had the same problem. In my case, for a legacy Rails 2.4 app. It seems brew had updated /usr/local/opt/openssl to symlink to openssl#1.1/1.1.1d.
After trying several other things, I fixed it by manually updating the symlink /usr/local/opt/openssl to point to the 1.0.2s version that was already on my system:
MacBook-Pro/usr/local/opt(:|✔) % pwd
/usr/local/opt
MacBook-Pro/usr/local/opt(:|✔) % ll openssl*
lrwxr-xr-x 1 dhempy admin 24 Feb 19 11:36 openssl -> ../Cellar/openssl/1.0.2s
lrwxr-xr-x 1 dhempy admin 28 Feb 19 08:55 openssl#1.1 -> ../Cellar/openssl#1.1/1.1.1d
Hopefully this is one-and-done for me, and I won't have to reapply that symlink after every update.
brew doctor gave me the following warning:
Warning: Some installed formulae are missing dependencies.
You should `brew install` the missing dependencies:
brew install openssl#1.1
this command fixed my issue
brew install openssl#1.1
Reinstalling watchman with brew solved the issue for me :
brew remove watchman
brew install watchman
I hope it helps,
This is the process I had to use to fix this issue. I am not sure how to use brew extract correctly.
We need openssl in order to use wget.
brew install openssl
Now, download version 1.0.2t and install it.
wget https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
brew install openssl.rb
If you are using a conda env, simply use
conda install -c bioconda samtools openssl=1.0
I had to run these commands because my problematic package appeared to be ldns:
brew uninstall --ignore-dependencies ldns
brew install ldns
I tried each and every one of these answers and still was getting the error from question.
Solution was to:
brew uninstall --ignore-dependencies openssl#<any&all brew ssl versions>
remove the files manually from /usr/local/etc (the locations of these are listed after step 1)
remedy the $PATH error: aka tell ssh command where it should be looking, by adding export PATH=/bin:/usr/bin:/usr/local/bin to ~/.zshrc or ~/.profile or ~/.bashrc depending on what shell you use.
hope this helps someone.

ideviceinstaller fails with "Could not connect to lockdownd. Exiting."

When I try to use ideviceinstaller, the command fails with the following error message:
"Could not connect to lockdownd. Exiting."
Example commands:
ideviceinstaller -l
ideviceinstaller -i Something.ipa
I have googled more than an hour to find the solution, however nothing worked for me:
Reinstall ideviceinstaller
Reinstall libimobiledevice
Reinstall brew and reinstall again both ideviceinstaller, libimobiledevice
It works only if I use sudo but it's unfortunately not acceptable in my case.
System paramereters:
MacBookPro with 10.11.5 OSX El Capitan
Target devices: iPhone 5, iPad 2
Note:
I have installed both Xcode 7.3.1 and Xcode 8 beta 3 on my computer. And used these commands to switch between them:
sudo xcode-select -switch /Applications/Xcode-beta.app/
sudo xcode-select -switch /Applications/Xcode.app/
Meanwhile I found the answer. This command will add durable privileges to use ideviceinstaller:
sudo chmod -R 777 /var/db/lockdown/
Just FYI: updates to macOS, iTunes, and probably other Apple software will (correctly) reset the permissions on /var/db/lockdown.
The best solution here is to get the latest libimobiledevice, which has a fix for this particular issue:
brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew link --overwrite libimobiledevice
brew install ideviceinstaller
brew link --overwrite ideviceinstaller
I had many problems with ideviceinstaller too, so at least I have started to use cfgutil.
It's a CLI tool of Apple Configurator 2, always up-to-date and reliable, works well with iOS beta versions.
Just download the free app from the App Store: https://itunes.apple.com/hu/app/apple-configurator-2/id1037126344
Start the app then select "Apple Configurator 2 > Install Automation Tools" from the upper left menu.
To install/uninstall apps:
cfgutil --ecid $ECID remove-app $BUNDLE_ID_OF_INSTALLED_APP;
cfgutil --ecid $ECID install-app $PATH_TO_IPA_OR_APP_FOLDER;
To get ECID, connect an iOS device and run the following command:
cfgutil list
Here are the available functions: https://pastebin.com/ZzeueLK2
When you try this command:
ideviceinstaller -d -i Something.ipa
you will get a detailed error. In my case the error is:
lockdown.c:218 lockdown_check_result(): ERROR: PairingDialogResponsePending
11:28:09 lockdown.c:1012 lockdownd_do_pair(): Pair failure
Could not connect to lockdownd.
Exiting.
On further searching for this error no. 2 I found that there was a trust issue in the Iphone connected, so I opened the Iphone and gave trust device, then the issue got resolved.
To fix this, try first:
usbmuxd --force-exit
sudo usbmuxd -f -v
Then
ideviceinstaller -d -i Something.ipa
bellow commands solved my problem
brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew unlink libimobiledevice && brew link libimobiledevice
brew install --HEAD ideviceinstaller
brew unlink ideviceinstaller && brew link ideviceinstaller
sudo chmod -R 777 /var/db/lockdown/
If you are getting this error while brew install --HEAD libimobiledevice
:
"configure: error: Package requirements (libusbmuxd >= 1.1.0) were not met:
Requested 'libusbmuxd >= 1.1.0' but version of libusbmuxd is 1.0.10"
Below commands will solve the issue:
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
use above mentioned command ->sudo chmod -R 777 /var/db/lockdown/
if the above command does not work then, remove files from lockdown folder
-> cd /var/db/lockdown/
-> rm -rf *
then try ->ideviceinstaller -l
In my case, the steps doesn't work.
Finally, I find a way to resolve:
DISCONNECT your device!
run cmd in sequence:
brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew install ideviceinstaller
sudo chmod -R 777 /var/db/lockdown
that works for me.

Can't link pcre thru brew in max os yosemite

When I install watchman using brew install watchman, it got this Error: You must brew link pcre before watchman can be installed. So I try brew link pcre and brew link --overwrite pcre, I just got
linking /usr/local/Cellar/pcre/8.36...
Error: Could not symlink share/man/man3/pcre.3
/usr/local/share/man/man3 is not writable.
Can anyone help?
By design Homebrew (brew) requires the contents of /usr/local to be owned by you. You can fix it easily by running:
sudo chown -R `whoami` /usr/local
from your Terminal.
See here for further explanation.
first
sudo chown -R 'your name' /usr/local
then
brew link pcre -f
then
brew install watchman
it should work

Error: Cowardly refusing to `sudo brew install` for installing glue 0.3 for Mac OSX Mountain Lion

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.

Resources