How to deal with conflict of brew formulas? - homebrew

For example, I want to be able to access errno from both moreutils and pwntools. Is there a way to just print out the installed directory of a package (in this case /usr/local/Cellar/moreutils/0.64) so that I can directory call the command with a full path (in this case /usr/local/Cellar/moreutils/0.64/bin/errno)?
$ brew info moreutils
moreutils: stable 0.65 (bottled), HEAD
Collection of tools that nobody wrote when UNIX was young
https://joeyh.name/code/moreutils/
Conflicts with:
parallel (because both install a `parallel` executable)
pwntools (because both install an `errno` executable)
sponge (because both install a `sponge` executable)
task-spooler (because both install a `ts` executable)
/usr/local/Cellar/moreutils/0.64 (68 files, 623.8KB)
Poured from bottle on 2020-09-04 at 23:44:26
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/moreutils.rb
License: GPL-2.0-or-later and (GPL-2.0-only or Artistic-2.0)
==> Dependencies
Build: docbook-xsl ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 2,161 (30 days), 9,268 (90 days), 28,848 (365 days)
install-on-request: 2,158 (30 days), 9,224 (90 days), 28,139 (365 days)
build-error: 0 (30 days)

Related

How to resolve the conflict between homebrew packages?

There are the following two packages in conflict. What is the correct way to resolve this conflict?
$ brew cask install rar
==> Downloading https://www.rarlab.com/rar/rarosx-5.9.1.tar.gz
Already downloaded: /Users/pengy/Library/Caches/Homebrew/downloads/fdb2cc1e1fa3b659b0fc92139bc9645b2ec844b68df1b1d25c5f956332af6cd1--rarosx-5.9.1.tar.gz
==> Installing Cask rar
==> Moving Generic Artifact 'default.sfx' to '/usr/local/lib/default.sfx'.
==> Moving Generic Artifact 'rarfiles.lst' to '/usr/local/etc/rarfiles.lst'.
==> Linking Binary 'rar' to '/usr/local/bin/rar'.
==> Unlinking Binary '/usr/local/bin/rar'.
==> Backing Generic Artifact 'rarfiles.lst' up to '/usr/local/Caskroom/rar/5.9.1/rar/rarfiles.lst'.
==> Removing Generic Artifact '/usr/local/etc/rarfiles.lst'.
==> Backing Generic Artifact 'default.sfx' up to '/usr/local/Caskroom/rar/5.9.1/rar/default.sfx'.
==> Removing Generic Artifact '/usr/local/lib/default.sfx'.
==> Purging files for version 5.9.1 of Cask rar
Error: It seems there is already a Binary at '/usr/local/bin/unrar'.
$ brew info unrar
unrar: stable 6.0.2 (bottled)
Extract, view, and test RAR archives
https://www.rarlab.com/
/usr/local/Cellar/unrar/5.9.4 (6 files, 503.5KB) *
Poured from bottle on 2020-09-04 at 23:47:13
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/unrar.rb
==> Analytics
install: 36,700 (30 days), 60,145 (90 days), 286,295 (365 days)
install-on-request: 28,778 (30 days), 48,112 (90 days), 221,675 (365 days)
build-error: 0 (30 days)
I just had this same problem pop up and a Google search led me here, but there was no answer :(
So I just took a leap of faith and uninstalled unrar:
$ brew uninstall unrar
Uninstalling ... (5 files, 505.8KB)
And then tried the installation of rar again:
$ brew install rar
...
==> Linking Binary 'rar' to '/usr/local/bin/rar'
==> Linking Binary 'unrar' to '/usr/local/bin/unrar'
🍺 rar was successfully installed!
And sure enough, without unrar installed the rar installation succeeded. I was able to verify this by running:
$ which rar
/usr/local/bin/rar
$ which unrar
/usr/local/bin/unrar

troubleshooting to upgrade Homebrew

any suggestion to resolve that trouble?
brew upgrade
==> Upgrading 1 outdated package:
patchelf 0.10 -> 0.11
==> Upgrading patchelf 0.10 -> 0.11
==> Downloading http://timelessname.com/elfbin/helloworld.tar.gz
Already downloaded: /home/felipe/.cache/Homebrew/downloads/e8943dd8577098994c9cc5eb1dc934bb5e93f97834dd65be5ea969e1d144deec--helloworld.tar.gz
==> Downloading https://github.com/NixOS/patchelf/archive/0.11.tar.gz
Already downloaded: /home/felipe/.cache/Homebrew/downloads/bbcd82d38c35bbbe19f8fc9c11c1a6a9294473a0c235cd5d295718d3108dd349--patchelf-0.11.tar.gz
==> ./configure --prefix=/home/linuxbrew/.linuxbrew/Cellar/patchelf/0.11 CXXFLAGS=-static-libgcc -static-libstdc++
Last 15 lines from /home/felipe/.cache/Homebrew/Logs/patchelf/01.configure:
2020-08-29 21:18:19 -0400
./configure
--prefix=/home/linuxbrew/.linuxbrew/Cellar/patchelf/0.11
CXXFLAGS=-static-libgcc -static-libstdc++
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
READ THIS: https://docs.brew.sh/Troubleshooting
These open issues may also help:
patchelf 0.12 https://github.com/Homebrew/linuxbrew-core/pull/21032
i'm trying to upgrade a brew but it's happening something wrong.
can you help me to fix it?
brew config
HOMEBREW_VERSION: 2.4.14
ORIGIN: https://github.com/Homebrew/brew
HEAD: fa39db0192c3641ed18abf93371c31e3a220348f
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Homebrew/linuxbrew-core
Core tap HEAD: a394692bb5092789dd8cf49561bf52cf61a1d228
Core tap last commit: 17 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :1
HOMEBREW_MAKE_JOBS: 12
CPU: dodeca-core 64-bit skylake
Homebrew Ruby: 2.6.3 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
Clang: N/A
Git: 2.20.1 => /bin/git
Curl: 7.64.0 => /usr/bin/curl
Kernel: Linux 4.19.0-8-amd64 x86_64 GNU/Linux
OS: Debian GNU/Linux 10 (buster) (buster)
Host glibc: 2.28
/usr/bin/gcc: 8.3.0
glibc: N/A
gcc: N/A
xorg: N/A
brew doctor
brew doctor
Your system is ready to brew.

brew utility on Linux: What's the difference from a something poured from a bottle vs built from source?

Here is one brew "package":
brew info pyenv
pyenv: stable 1.2.18 (bottled), HEAD
Python version management
https://github.com/pyenv/pyenv
/usr/local/Cellar/pyenv/1.2.16 (671 files, 2.5MB)
Poured from bottle on 2020-03-09 at 20:39:44
/usr/local/Cellar/pyenv/1.2.17 (696 files, 2.5MB) *
Poured from bottle on 2020-03-20 at 11:02:14
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/pyenv.rb
==> Dependencies
Required: autoconf ✔, openssl#1.1 ✘, pkg-config ✘, readline ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 48,345 (30 days), 179,715 (90 days), 619,315 (365 days)
install-on-request: 46,259 (30 days), 168,874 (90 days), 572,926 (365 days)
build-error: 0 (30 days)
Here is a different brew "package" I have installed:
brew info pyenv-virtualenv
pyenv-virtualenv: stable 1.1.5, HEAD
Pyenv plugin to manage virtualenv
https://github.com/pyenv/pyenv-virtualenv
/usr/local/Cellar/pyenv-virtualenv/1.1.5 (22 files, 65.4KB) *
Built from source on 2020-03-20 at 11:12:52
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/pyenv-virtualenv.rb
==> Dependencies
Required: pyenv ✘
==> Options
--HEAD
Install HEAD version
==> Caveats
To enable auto-activation add to your profile:
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
==> Analytics
install: 9,469 (30 days), 32,494 (90 days), 104,366 (365 days)
install-on-request: 9,365 (30 days), 32,015 (90 days), 102,918 (365 days)
build-error: 0 (30 days)
Why is one "poured from bottle" and the other one is "built from source". What's the difference between the two?
A "bottle" is, in Homebrew’s jargon, a pre-compiled package. "Poured from bottle" means "installed using a pre-compiled package". pyenv has a bottle because it requires compilation while pyenv-virtualenv does not.
See the docs.

brew install does not select bottle

I am trying to install MySQL using Homebrew.
➜ ~ brew install mysql
==> Downloading https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-5.7.19.tar.gz
Already downloaded: /Users/youri/Library/Caches/Homebrew/mysql-5.7.19.tar.gz
==> cmake . -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mysql/5.7.19 -DCMAKE_
load: 2.07 cmd: cmake 67907 running 1.22u 1.81s
load: 1.98 cmd: ruby 69196 running 0.03u 0.00s
load: 1.98 cmd: ruby 69218 running 0.01u 0.00s
load: 1.98 cmd: ruby 69236 running 0.02u 0.00s
load: 1.98 cmd: make 69256 running 0.00u 0.00s
load: 1.98 cmd: clang 69273 running 0.04u 0.01s
load: 1.98 cmd: ruby 69291 running 0.00u 0.00s
==> make
Why doesn’t Homebrew select a bottled version of mysql instead of building it from source?
Edit: i am using High Sierra last beta
There can be two reasons why you don’t get a bottle:
You use a custom prefix and the formula doesn’t support it
The formula doesn’t have a bottle for your OS
You fall in the second case: Homebrew doesn’t provide bottles for High Sierra. mysql.rb only has bottles for Sierra, El Capitan, and Yosemite.

RVM Ruby Installation Fail on OS X 10.9.3?

I am receiving an error when running the RVM command to install Ruby on my OSX machine. The output is below:
ThisComp:~ *************$ \curl -L https://get.rvm.io | bash -s stable --ruby
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 330 0 --:--:-- --:--:-- --:--:-- 330
100 20511 100 20511 0 0 18860 0 0:00:01 0:00:01 --:--:-- 9.7M
Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz
Upgrading the RVM installation in /Users/************/.rvm/
RVM PATH line found in /Users/*************/.profile /Users/*************/.bashrc /Users/***********/.zshrc.
RVM sourcing line found in /Users/*********/.bash_profile /Users/**********/.zlogin.
Upgrade of RVM in /Users/*************/.rvm/ is complete.
# msutyak,
#
# Thank you for using RVM!
# We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.
In case of problems: http://rvm.io/help and https://twitter.com/rvm_io
Upgrade Notes:
* WARNING: You have '~/.profile' file, you might want to load it,
to do that add the following line to '/Users/*************/.bash_profile':
source ~/.profile
* No new notes to display.
rvm 1.25.26 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.9/x86_64/ruby-2.1.2.tar.bz2
Checking requirements for osx.
Installing requirements for osx.
Updating system......
Installing required packages: automake...
Error running 'requirements_osx_brew_libs_install automake',
showing last 15 lines of /Users/***************/.rvm/log/1401388968_ruby-2.1.2/package_install_automake.log
++ /scripts/functions/logging : rvm_pretty_print() 81 > case "$1" in
++ /scripts/functions/logging : rvm_pretty_print() 82 > [[ -t 1 ]]
++ /scripts/functions/logging : rvm_pretty_print() 82 > return 1
++ /scripts/functions/logging : rvm_warn() 139 > printf %b 'There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/mxcl/homebrew/wiki/Installation\n'
There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/mxcl/homebrew/wiki/Installation
++ /scripts/functions/requirements/osx_brew : requirements_osx_brew_libs_install() 63 > case "$_system_version" in
++ /scripts/functions/requirements/osx_brew : requirements_osx_brew_libs_install() 70 > return 1
Requirements installation failed with status: 1.
When I type brew tap --repair, I receive the following error:
Pruned 0 dead formulae
Does anyone know what is going on and what I can do to rectify the situation? I'm not sure why there are package installation errors.
EDIT:
ThisMachine:~ ************$ brew link --overwrite --dry-run autoconf
Would remove:
/usr/local/bin/ifnames
/usr/local/bin/autoupdate
/usr/local/bin/autoscan
/usr/local/bin/autoreconf
/usr/local/bin/autom4te
/usr/local/bin/autoheader
/usr/local/bin/autoconf
/usr/local/share/man/man1/ifnames.1
/usr/local/share/man/man1/config.sub.1
/usr/local/share/man/man1/config.guess.1
/usr/local/share/man/man1/autoupdate.1
/usr/local/share/man/man1/autoscan.1
/usr/local/share/man/man1/autoreconf.1
/usr/local/share/man/man1/autom4te.1
/usr/local/share/man/man1/autoheader.1
/usr/local/share/man/man1/autoconf.1
/usr/local/share/emacs/site-lisp/autotest-mode.elc
/usr/local/share/emacs/site-lisp/autotest-mode.el
/usr/local/share/emacs/site-lisp/autoconf-mode.elc
/usr/local/share/emacs/site-lisp/autoconf-mode.el
/usr/local/share/autoconf/m4sugar/version.m4
/usr/local/share/autoconf/m4sugar/m4sugar.m4f
/usr/local/share/autoconf/m4sugar/m4sugar.m4
/usr/local/share/autoconf/m4sugar/m4sh.m4f
/usr/local/share/autoconf/m4sugar/m4sh.m4
/usr/local/share/autoconf/m4sugar/foreach.m4
/usr/local/share/autoconf/INSTALL
/usr/local/share/autoconf/autotest/specific.m4
/usr/local/share/autoconf/autotest/general.m4
/usr/local/share/autoconf/autotest/autotest.m4f
/usr/local/share/autoconf/autotest/autotest.m4
/usr/local/share/autoconf/autoscan/autoscan.list
/usr/local/share/autoconf/autom4te.cfg
/usr/local/share/autoconf/Autom4te/XFile.pm
/usr/local/share/autoconf/Autom4te/Request.pm
/usr/local/share/autoconf/Autom4te/Getopt.pm
/usr/local/share/autoconf/Autom4te/General.pm
/usr/local/share/autoconf/Autom4te/FileUtils.pm
/usr/local/share/autoconf/Autom4te/Configure_ac.pm
/usr/local/share/autoconf/Autom4te/Channels.pm
/usr/local/share/autoconf/Autom4te/ChannelDefs.pm
/usr/local/share/autoconf/Autom4te/C4che.pm
/usr/local/share/autoconf/autoconf/types.m4
/usr/local/share/autoconf/autoconf/status.m4
/usr/local/share/autoconf/autoconf/specific.m4
/usr/local/share/autoconf/autoconf/programs.m4
/usr/local/share/autoconf/autoconf/oldnames.m4
/usr/local/share/autoconf/autoconf/libs.m4
/usr/local/share/autoconf/autoconf/lang.m4
/usr/local/share/autoconf/autoconf/headers.m4
/usr/local/share/autoconf/autoconf/go.m4
/usr/local/share/autoconf/autoconf/general.m4
/usr/local/share/autoconf/autoconf/functions.m4
/usr/local/share/autoconf/autoconf/fortran.m4
/usr/local/share/autoconf/autoconf/erlang.m4
/usr/local/share/autoconf/autoconf/c.m4
/usr/local/share/autoconf/autoconf/autoupdate.m4
/usr/local/share/autoconf/autoconf/autotest.m4
/usr/local/share/autoconf/autoconf/autoscan.m4
/usr/local/share/autoconf/autoconf/autoheader.m4
/usr/local/share/autoconf/autoconf/autoconf.m4f
/usr/local/share/autoconf/autoconf/autoconf.m4
ThisMachine:~ *************$ brew link --overwrite autoconf
Linking /usr/local/Cellar/autoconf/2.69...
Error: Could not symlink share/emacs/site-lisp/autotest-mode.elc
/usr/local/share/emacs/site-lisp is not writable.
ThisMachine:~ *************$ brew install automake
Error: You must `brew link autoconf' before automake can be installed
Running brew link autoconf:
ThisMachine:~ ************$ brew link autoconf
Linking /usr/local/Cellar/autoconf/2.69...
Error: Could not symlink share/emacs/site-lisp/autotest-mode.elc
Target /usr/local/share/emacs/site-lisp/autotest-mode.elc
already exists. You may want to remove it:
rm /usr/local/share/emacs/site-lisp/autotest-mode.elc
To force the link and overwrite all conflicting files:
brew link --overwrite autoconf
To list all files that would be deleted:
brew link --overwrite --dry-run autoconf
Installation of automake has failed. Try installing it manually using brew:
brew install automake
This post has some additional tips for installing automake in case you get other errors: Error running 'requirements_osx_brew_libs_install...' on Mac 10.7

Resources