Can't install nano via homebrew on m1 Mac - homebrew

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`).

Related

Problem when installing openconnect using brew

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.

brew cannot install go#1.13 while brew search shows it

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

Installing elixir with homebrew fails due to jpeg

I'm trying to install elixir and it fails installing one of its dependencies, jpeg:
$ brew install elixir
==> Installing dependencies for elixir: jpeg, libtiff, wxmac, erlang
Error: /usr/local/Library/LinkedKegs/jpeg is not a valid keg
So of course I try brew install jpeg and a few others:
$ brew install jpeg
Error: jpeg-jpeg already installed
To install this version, first `brew unlink jpeg'
$ brew unlink jpeg
Error: No such keg: /usr/local/Cellar/jpeg
$ brew info jpeg
jpeg: stable 8d (bottled)
JPEG image manipulation library
http://www.ijg.org
Not installed
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/jpeg.rb
==> Options
--universal
Build a universal binary
And if I run brew doctor, it just tells me to install jpeg. Has anyone run into this before? I'm on Yosemite 10.10.5. I didn't expect to see jpeg-jpeg already installed after trying to install jpeg.
My brew --config:
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 070b76df5a4096dcc6196fc51e56185ae7dfd617
Last commit: 80 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit broadwell
OS X: 10.10.5-x86_64
Xcode: 7.1
CLT: 7.1.0.0.1.1444952191
Clang: 7.0 build 700
X11: N/A
System Ruby: 2.0.0-p481
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /Users/Me/.rbenv/shims/ruby => /Users/Me/.rbenv/versions/2.1.2/bin/ruby
Java: 1.8.0_51, 1.6.0_65-b14-468
Updated with brew remove --force jpeg:
$ brew remove --force jpeg
$ brew install jpeg
Error: jpeg-jpeg already installed
To install this version, first `brew unlink jpeg'
I ended up getting this to work by following guidance in https://github.com/Homebrew/homebrew/issues/37250. Specifically, this comment. Following that, I just removed the directory at /usr/local/Library/LinkedKegs/jpeg and was then able to install jpeg just fine.

fail install hhvm with homebrew

i try to install hhvm via
brew install hhvm
i got this error :
Sinas-MacBook-Pro:~ sinamiandashti$ brew install hhvm
==> Downloading https://github.com/facebook/hhvm/archive/HHVM-3.2.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/hhvm-3.2.0.tar.gz
==> Patching
patching file hphp/runtime/ext/gd/libgd/gdft.cpp
Hunk #1 FAILED at 63.
1 out of 1 hunk FAILED -- saving rejects to file hphp/runtime/ext/gd/libgd/gdft.cpp.rej
the formula is fixed
plz use
brew install hhvm --HEAD

How can I force homebrew to recompile?

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

Resources