How to resolve the conflict between homebrew packages? - homebrew

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

Related

How to deal with conflict of brew formulas?

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)

how to download brew resource manually and install?

My internet has interference so brew installation procedure may failure sometimes.
==> Downloading https://github.com/openjdk/jdk/commit/f80a6066e45c3d53a61715abfe71abc3b2e162a1.patch?full_index=1
######################################################################## 100.0%
==> Downloading https://github.com/openjdk/jdk/commit/4622a18a72c30c4fc72c166bee7de42903e1d036.patch?full_index=1
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Error: Failed to download resource "openjdk--patch"
Download failed: https://github.com/openjdk/jdk/commit/4622a18a72c30c4fc72c166bee7de42903e1d036.patch?full_index=1
I manage to got that file, but I don't known the correct filename for brew.
brew --cache openjdk--patch
Error: No available formula or cask with the name "openjdk--patch".
brew --cache -s openjdk
~/Library/Caches/Homebrew/downloads/336948b1d9a8eba79fadf26569f4af0cb2fe147fde214fc9d9bf6b66f2f927d2--jdk15u-jdk-15.0.1-ga.tar.bz2
So how to got the correct filename for this patch?
I found the tricky, just run
brew install package-name -d
it will print each cache name of resources used by package-name

I am trying to install docker on centos8 vagrantbox facing the error 'Downloading successful, but checksum doesn't match'

[MIRROR] containerd.io-1.2.0-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: ece851b2b2defa24eb3b817b14d97f31f4043a713d7367972bd2c1ef4f2788b8(sha256) Expected: 7bd1d8da7d896ead55fdea3a42100eac4c4d7800f958d3ae056d40268dec4636(sha256)
(8/21): python3-policycoreutils-2.9-9.el8.noarch.rpm 107 kB/s | 2.2 MB 00:21
[MIRROR] containerd.io-1.2.0-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: 3928fc6c58817b02602a249e512d7e99b7c3fe06ea5d9ff3ad46e25984ff8141(sha256) Expected: 7bd1d8da7d896ead55fdea3a42100eac4c4d7800f958d3ae056d40268dec4636(sha256)
[MIRROR] docker-ce-18.09.1-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: 3ddabd445a05b85aeba128da42283d3285ca8055e6a201139ee49b682942ba43(sha256) Expected: 6034f83c3bf3d5d31120ef36b3172dbb28d1ac8ae3699ed8cb33924dcef0d17a(sha256)
[MIRROR] containerd.io-1.2.0-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: 3914815a5c9756672d6f046929335ddff86607c29ac8a3c3fc12452a69952bf7(sha256) Expected: 7bd1d8da7d896ead55fdea3a42100eac4c4d7800f958d3ae056d40268dec4636(sha256)
[FAILED] containerd.io-1.2.0-3.el7.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success
(10-11/21): docker-ce-18.09.1-3.el7.x86_64.rpm 50% [============================================== ] 1.4 MB/s | 50 MB 00:35 ETA
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Error: Error downloading packages:
Cannot download Packages/containerd.io-1.2.0-3.el7.x86_64.rpm: All mirrors were tried
Error: Transaction test error: package selinux-policy-targeted-3.14.3-41.el8_2.5.noarch does not verify: Header SHA1 digest: BAD (Expected ab8b3fe6b75faa65c89e64ec34986ee49924f982 != 3716bcc257255e43bc9ace1b9c4aecb6fcba3e61) package python3-policycoreutils-2.9-9.el8.noarch does not verify: Header SHA1 digest: BAD (Expected af32d12b99154706740619e0ac39289c009f1aa9 != faa84ee41c25523f2a05358d172f124370c18f99) package containerd.io-1.2.6-3.3.el7.x86_64 does not verify: no digest
''' Please help me to install docker on centos8 to fix this issue SHA1 digest: BAD '''
Try installing packages containerd manually:
yum clean packages #clean packages from failed install
dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm #install newest containerd manually
sudo yum install docker-ce docker-ce-cli #install Docker daemon and CLI
Links:
Install Docker on CentOS
Docker documentation for installation
on CentOS
Docker CentOS repository

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.

Carthage Update Not Happening

I know it's duplicate but I have searched and tried many things but update not happening
Tried :
Carthage Update
rm -rf ~/Library/Caches/org.carthage.CarthageKit and carthage update --platform iOS
brew install carthage --HEAD
==> Cloning https://github.com/Carthage/Carthage.git Cloning into '/Users/xxxx/Library/Caches/Homebrew/carthage--git'... remote:
Counting objects: 20918, done. remote: Compressing objects: 100%
(6/6), done. remote: Total 20918 (delta 0), reused 1 (delta 0),
pack-reused 20912 Receiving objects: 100% (20918/20918), 18.03 MiB |
815.00 KiB/s, done. Resolving deltas: 100% (13727/13727), done.
==> Checking out branch master
==> make prefix_install PREFIX=/usr/local/Cellar/carthage/HEAD-256ae62 Error: The brew link step did not complete successfully The formula
built, but is not symlinked into /usr/local Could not symlink
bin/carthage Target /usr/local/bin/carthage already exists. You may
want to remove it: rm '/usr/local/bin/carthage'
To force the link and overwrite all conflicting files: brew link
--overwrite carthage
To list all files that would be deleted: brew link --overwrite
--dry-run carthage
Possible conflicting files are: /usr/local/bin/carthage
==> Caveats Bash completion has been installed to: /usr/local/etc/bash_completion.d
zsh completions have been installed to:
/usr/local/share/zsh/site-functions
==> Summary 🍺 /usr/local/Cellar/carthage/HEAD-256ae62: 69 files, 23.9MB, built in 6 minutes 7 seconds
Please update to the latest Carthage version: 0.30.1. You currently
are on 0.26.2
I could not update it.

Resources