See what options I used when I installed a brew package - homebrew

How can I check which options I installed a brew package with? For example, I have homebrew gcc installed. Is there someway to check if it was installed with the --multi-lib option?

brew info will display the options used. Also, each install contains a file INSTALL_RECEIPT.json in its Cellar directory for keeping track of used and unused options.

Related

brew doctor warnings - delete or ignore?

After I installed Homebrew,
Then I try the brew doctor command, there comes warnings:
Could I know the reasons and How to fix it? Could I just ignore these warnings?
The files reported by brew doctor are added by a software (that you manually installed before installing Homebrew) that uses a library for the Tcl/Tk language.
Homebrew also provides a library for Tcl/Tk and the existing files will conflict with those installed by Homebrew if you install a package that requires the Tcl/Tk library.
You don't have to worry for now and, very important, don't try to "fix" anything (especially don't remove files).
What you can do to "fix" it is to find out what program installed those files (it was not installed using the App Store, you installed it manually) and see if Homebrew provides it. If it is a macOS GUI application then Homebrew doesn't provide it (it contains only command line applications, no GUI) but Homebrew Cask might do it.
Use
$ brew search app
or
$ brew cask search app
If you are lucky and you find it and you are pleased with the version provided by Homebrew then you can uninstall the application using the uninstaller it hopefully provides then reinstall it using Homebrew (or Homebrew Cask).
You can run brew doctor between uninstall and reinstall to make sure the uninstaller removed all the files listed in the output of brew doctor now.
As written at the beginning of brew doctor's output, you can safely ignore these warnings if everything you use Homebrew for works fine.

Warnings when running meld on Mac OS X Sierra

I've installed homebrew on my machine. Using brew I've installed meld. When I run it with git I get the following error:
Couldn't bind the translation domain. Some translations won't work.
'module' object has no attribute 'bindtextdomain'
2016-10-20 10:14:08.422 Python[22212:158273] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
(meld:22212): Gdk-WARNING **: GdkQuartzDisplay does not implement the monitor vfuncs
I don't understand how exactly brew works. In fact I never dug into its code, used it only to (un)install the software.
Did some online searches but there doesn't seem to be a solution to this. Has anyone figured it out?
Homebrew is simply a a package manager for MacOS. Unlike Linux, Mac doesn't always have all the external libraries you may need for things like wget, pip, etc out of the box. Homebrew tries to bridge this gap.
As for troubleshooting your issue, following Homebrew's troubleshooting steps helped me... You are probably just stuck in dependency hell, since Homebrew integrates alot of its libraries with Xcode (for me it was needing to update Xcode to latest): https://github.com/Homebrew/brew/blob/master/docs/Troubleshooting.md#troubleshooting
It's really important to keep thing up-to-date with brew update and then running brew doctor and brew prune resolved alot of issues for me as well.
If all else fails, homebrew seemed to have moved the meld formulae from homebrew/core to caskroom/cask. So I recall having to run the following command after running brew doctor and updating Xcode:
$ brew uninstall meld
$ brew install meld
Error: No available formula with the name "meld"
It was migrated from homebrew/core to caskroom/cask.
You can access it again by running:
brew tap caskroom/cask
$ brew tap caskroom/cask
$ brew cask install meld
==> Downloading https://github.com/yousseb/meld/releases/download/osx-9/meldmerge.dmg
######################################################################## 100.0%
==> Verifying checksum for Cask meld
==> Moving App 'Meld.app' to '/Applications/Meld.app'.
==> Linking Binary 'Meld' to '/usr/local/bin/meld'.
🍺 meld was successfully installed!

multiple side-by-side versions with Homebrew?

Is it possible to install multiple versions side-by-side with Homebrew?
I find myself in a situation needing sbt-0.7.x, sbt-0.10.x and sbt-0.11.0. I've installed both sbt-0.7.7 and sbt-0.10.1 manually at the moment to work around the issue (with sbt-0.11.0 being the latest 'sbt' from Homebrew).
Yeah. When you install a new version of a package, it keeps the old one. The symlinks in /usr/local/bin or wherever point to the latest version, but you can still call the binaries (or link to the libraries) in the older version.
brew list to see what's installed. You can look in package directories to see all the versions; or call brew list --versions to see all packages and all versions.
To easily switch between versions of formulae, you can use:
brew switch <formula> <version>
For example:
brew switch gradle 3.2.1
To list which versions you have installed try:
brew list --versions
or:
brew list <formula> --versions
If you want to get rid of older versions, just use:
brew cleanup
As of Homebrew 2.0.0, it would remove old packages automatically when brew upgrade is called. (https://brew.sh/2019/02/02/homebrew-2.0.0/). To opt-out of this behavior, set the environment variable: export HOMEBREW_NO_INSTALL_CLEANUP=1

Can I do a dry run with homebrew to see the details of what will be installed and how?

Is it possible to run in a verbose mode where it doesn't actually install the package, but just details from where and how it will be install the package?
You can run brew outdated to see a list of outdated packages that will be upgraded when running brew upgrade.
The closest you'll find is to show the dependencies of the package you're trying to install:
$ brew deps ruby
Will list the packages of ruby. You can then use:
$ brew list
to see which packages you have installed. From these two commands, you will be able to tell which packages will be installed by brew install ruby
I've used gentoo linux quite a bit in the past, and their portage system has a nice 'pretend' option for installing packages, the closest I've found for brew is:
brew list (package name)
brew list ruby gives me:
/usr/local/Cellar/ruby/1.9.2-p0/bin/tilt
/usr/local/Cellar/ruby/1.9.2-p0/bin/testrb
/usr/local/Cellar/ruby/1.9.2-p0/bin/ruby
/usr/local/Cellar/ruby/1.9.2-p0/bin/ri
/usr/local/Cellar/ruby/1.9.2-p0/bin/rdoc
/usr/local/Cellar/ruby/1.9.2-p0/bin/rake
/usr/local/Cellar/ruby/1.9.2-p0/bin/rackup
/usr/local/Cellar/ruby/1.9.2-p0/bin/irb
/usr/local/Cellar/ruby/1.9.2-p0/bin/gem
/usr/local/Cellar/ruby/1.9.2-p0/bin/erb
/usr/local/Cellar/ruby/1.9.2-p0/include/ruby-1.9.1/ (21 files)
/usr/local/Cellar/ruby/1.9.2-p0/lib/libruby.1.9.1.dylib
/usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/ (998 files)
/usr/local/Cellar/ruby/1.9.2-p0/lib/ (3 other files)
/usr/local/Cellar/ruby/1.9.2-p0/share/man/ (5 files)
/usr/local/Cellar/ruby/1.9.2-p0/share/ri/ (9522 files)
But I'm guessing you're looking for more info than this?
The brew install --dry-run feature was recently added.
brew install --dry-run vim
==> Would install 1 formula:
vim
==> Would install 5 dependencies for vim:
lua berkeley-db perl libyaml ruby

uninstall a manually compiled package in unix

I have installed imagemagick by downloading and compiling the source.how to correctly uninstall the ImageMagick that was manually installed in order to installed rmagick gem.
Is there something like "make uninstall".
There's no standard procedure.
Sometimes makefiles provide an uninstall rule you can run in order to remove files installed by install.
If Imagemagick doesn't provide any tool to uninstall itself you'll have to manually remove it by removing the files it installed.
Imagemagick provides standard uninstall procedure if you have compiled it from source.
1. cd source_dir
2. make uninstall
From docs:
make uninstall
Remove all files from the system which are (or would
be) installed by sudo make install using the current configuration.
Note that this target is imperfect for PerlMagick since Perl no longer
supports an uninstall target.

Resources