How can I force homebrew to recompile? - homebrew

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

Related

New MacBook Homebrew Install Issue

I have a Macbook Pro that has an M1 Chip that is causing issues trying to install Homebrew. I have followed the steps in this article: https://mac.install.guide/homebrew/3.html but when I get to the Homebrew install and I type brew in the terminal I get this
Example usage:
brew search TEXT|/REGEX/
brew info [FORMULA|CASK...]
brew install FORMULA|CASK...
brew update
brew upgrade [FORMULA|CASK...]
brew uninstall FORMULA|CASK...
brew list [FORMULA|CASK...]
Troubleshooting:
brew config
brew doctor
brew install --verbose --debug FORMULA|CASK
Contributing:
brew create URL [--no-fetch]
brew edit [FORMULA|CASK...]
Further help:
brew commands
brew help [COMMAND]
man brew
https://docs.brew.sh
Shouldn't it tell me what version of Homebrew I have and that it's installed?
I am trying to set up my Homebrew so that I can use it with git. I am trying to do brew install git and brew install git-lfs but I get the below error messages when I try to do that.
fatal: Could not resolve HEAD to a revision
Warning: No available formula with the name "git".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
Shouldn't it tell me what version of Homebrew I have and that it's installed?
To find the installed version, use the -v option.
% brew -v
Homebrew 3.6.0
Homebrew/homebrew-core (git revision e5722d08e47; last commit 2022-09-09)
Homebrew/homebrew-cask (git revision 0dc06a0f09; last commit 2022-09-09)
fatal: Could not resolve HEAD to a revision
You will need to reinstall, and make sure it uses /opt/homebrew because you are on an M1.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
There shouldn't be any errors displayed when this runs.

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.

brew install rbenv Error: rbenv-rbenv already installed To install this version, first `brew unlink rbenv`

I am trying to install rbenv on OS X by following instruction from site link - setup ruby on macbook
when I try brew install rbenv I get below error
Error: rbenv-rbenv already installed To install this version, first 'brew unlink rbenv'
Here is the output from brew doctor
brew doctor
Your system is ready to brew.
I tried brew unlink rbenv on which fails with message Error: No such keg: /usr/local/Cellar/rbenv
Please suggest how this can be solved.
I have tried all solutions as listed below
brew update
brew prune
brew link rbenv
nothing really works
This, I was able to solve by thrashing all the junk files and folders related to rbenv still existing in the system; as brew link rbenv wasn't working
Use command below to find any rbenv files/folder still existing in the system.
sudo find /user/ -name "*rbenv*"
most of the issues could be because /usr/local/opt may still have folders related to rbenv
then carefully remove any listed files/folder using command
sudo rm -r <folder-listed-in-result-of-above-command>
then try brew install rbenv, follow any output from this command (which may suggest brew unlink rbenv && brew link rbenv) and you should be good to go.
I do not recommend file/folder thrashing this way as it could be risky however, to be frank, this is only what worked for me.

How to uninstall Homebrew Cask

I installed Homebrew Cask for kicks as described at http://caskroom.io/. It boils down to the following command:
$ brew install caskroom/cask/brew-cask
$ brew tap caskroom/versions
Homebrew Cask installed and everything was fine. Then I uninstalled Homebrew Cask like so:
$ brew untap caskroom/versions
$ brew uninstall brew-cask
Here are the current taps:
$ brew tap
homebrew/versions
Yet I see stuff from Cask when searching for items that wouldn't be part of Homebrew itself (like Graphical programs, aText, Fantastical etc.):
$ brew search atext
Caskroom/cask/atext
Though it doesn't install (as expected):
$ brew install atext
Error: No available formula for atext
Searching formulae...
Searching taps...
Caskroom/cask/atext
So the question is why does brew search Caskroom/cask and how do I get rid of it (I don't want Homebrew telling me it has aText, for example, when it can't install it)?
I am running Mac OS X Yosemite.
For the current version of Brew:
$ brew uninstall --cask yed
For older versions of Brew:
$ brew cask uninstall yed
the result:
==> Removing App symlink: '/Users/user/Applications/yEd.app'
As of Homebrew version 0.9.5, it appears that brew search will find items in Caskroom/cask/ without actually having Homebrew Cask installed. You can also install them, but this will actually install brew-cask as a dependency along the way.
Try:
brew install Caskroom/cask/atext
Command the terminal to "untap" at the prompt [MacOS Catalina 10.15.2]
Run
brew untap homebrew/cask-fonts
Expected output
Untapping homebrew/cask-fonts...
Untapped 1571 casks (1,713 files, 11.4MB)

Please install libyaml and reinstall your ruby

libyaml warning doesn't go away, even if you install libyaml
gem install bundler
/home/ec2-user/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
Fetching: bundler-1.3.4.gem (100%)
Successfully installed bundler-1.3.4
First remove any previous docs of yaml by
cd .rvm/src
sudo rm -rf yaml*
Then you can do rest of the install by -
rvm pkg install libyaml
P.S You will need to reinstall ruby after this.
UPDATE: If rvm pkg seems to be deprecated. You can compile a source on your own. All you
gotta do is download the latest version of libyaml from http://pyyaml.org/download/libyaml/
tar zxf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure
make
make install
UPDATE2: BTW, you could still use rvm pkg and/or when reinstalling ruby make sure to enbale autolibs by
\curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable
A friend of mine had a similar problem on his mac.
brew install libyaml
ended up working for us and we were able to avoid a reinstall of ruby.
If using homebrew, a temporary fix that worked for me was to run:
brew unlink libyaml && brew link libyaml
plus you may also need to run:
brew unlink openssl && brew link --force openssl
See this issue thread for more details: https://github.com/wayneeseguin/rvm/issues/2689

Resources