I'm on the new M1 MacBook Pro. I'm trying to install gtk+3 (which has native apple silicon support) via Homebrew. First it told me
Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)! Please create a new installation in /opt/homebrew using one of the "Alternative Installs" from: https://docs.brew.sh/Installation You can migrate your previously installed formula list with: brew bundle dump
I tried to run the terminal via Rosetta 2, but gtk+3 needs ARM support to install, so that didn't work.
I tried to manually unzip the code line in docs.brew.sh in /opt/
but it told me I don't have permission. I tried to sudo it, but to no avail. Any help?
Edit 1: for full message:
brew install gtk+3
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
libbsd
==> Updated Formulae
Updated 18 formulae.
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)! Please create a new installation in /opt/homebrew using one of the "Alternative Installs" from: https://docs.brew.sh/Installation You can migrate your previously installed formula list with: brew bundle dump
Edit 2: Created a folder called 'Home-brew' in /opt/ and opened terminal there, tried sudo and everything:
oresttokovenko@Orests-MacBook-Pro-2 Homebrew % sudo chmod 755
Password:
usage: chmod [-fhv] [-R [-H | -L | -P]] [-a | +a | =a [i][# [ n]]] mode|entry file ...
chmod [-fhv] [-R [-H | -L | -P]] [-E | -C | -N | -i | -I] file ...
oresttokovenko@Orests-MacBook-Pro-2 Homebrew % https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
zsh: no such file or directory: https://github.com/Homebrew/brew/tarball/master
tar: could not chdir to 'homebrew'
oresttokovenko@Orests-MacBook-Pro-2 Homebrew % curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 128 100 128 0 0 254 0 --:--:-- --:--:-- --:--:-- 255
0 1979k 0 598 0 0 682 0 0:49:32 --:--:-- 0:49:32 682tar: could not chdir to 'homebrew'
1 1979k 1 33478 0 0 34728 0 0:00:58 --:--:-- 0:00:58 364k
curl: (23) Failed writing body (0 != 1370)
oresttokovenko@Orests-MacBook-Pro-2 Homebrew % sudo curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 128 100 128 0 0 348 0 --:--:-- --:--:-- --:--:-- 348
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0tar: could not chdir to 'homebrew'
1 1979k 1 34138 0 0 41887 0 0:00:48 --:--:-- 0:00:48 129k
curl: (23) Failed writing body (0 != 1370)
Now, on your new M1 Mac, you can install Homebrew with /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" . After the install is complete you'll see a message similar to the one below. Remember, Homebrew is now going to install packages in /op/homebrew/bin .
If Homebrew is successfully installed, there will be Homebrew files in /usr/local (for macOS Intel) or /opt/homebrew (for Apple Silicon).
It's already in PATH. This means that tools installed with homebrew can be accessed without any need to change anything. Quite a few build systems already look in /usr/local , so libraries installed with homebrew can be used by non-homebrew tools.
I've used the script written by Noah Rubin;
/bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/nrubin29/bea5aa83e8dfa91370fe83b62dad6dfa/raw/48f48f7fef21abb308e129a80b3214c2538fc611/homebrew_m1.sh)"
worked like a charm! Here is his youtube video on this topic for more info; https://youtu.be/nv2ylxro7rM
Edit: Forgot to mention, this script installs the homebrew into /opt/homebrew
I solved it running under the Rosetta Terminal
Locate the Terminal application within the Utilities folder (Finder> Go menu > Utilities)
Select Terminal.app and right-click on it, then choose “Duplicate” Rename the duplicated Terminal app something obvious and distinct, like ‘Rosetta Terminal’
Now select the freshly renamed ‘Rosetta Terminal’ app and right-click and choose “Get Info” (or hit Command+i)
Check the box for “Open using Rosetta”, then close the Get Info window Run the “Rosetta Terminal” as usual, which will fully support Homebrew and other x86 command line apps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With