Brew linking with ImageMagick - ruby-on-rails

Installing:
ostaptan:~ ostap$ brew install imagemagick --disable-openmp --from-source
==> Downloading http://downloads.sf.net/project/machomebrew/mirror/ImageMagick-6.7.7-6.tar.bz2
Already downloaded: /Library/Caches/Homebrew/imagemagick-6.7.7-6.tar.bz2
==> Patching
patching file configure
Hunk #1 succeeded at 32371 (offset 447 lines).
==> ./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.7.7-6 --enable-shared --disable-static
==> make install
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link imagemagick'
==> Summary
/usr/local/Cellar/imagemagick/6.7.7-6: 1388 files, 32M, built in 61 seconds
linking after bad linking in install:
ostaptan:wand ostap$ brew link imagemagick
Linking /usr/local/Cellar/imagemagick/6.7.7-6...
Error: Could not symlink file: /usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/wand/wand-view.h
Target /usr/local/include/ImageMagick/wand/wand-view.h already exists. You may need to delete it.
To force the link and delete this file, do:
brew link -f formula_name
To list all files that would be deleted:
brew link -n formula_name
How to link??? what to do?? Can't find answers anywhere!

As suggested in the brew link output, try
brew link -f imagemagick
This should clean up old links in /usr/local/include/ImageMagick/, and then link the files required to complete the installation.
If this doesn't work check that your user has permission to write to /usr/local/include/ImageMagick/*.

After hours and hours of trying the only thing that worked for me was:
sudo brew link --overwrite imagemagick
(Also requires /usr/local/bin/brew to be chowned to root)

Homebrew does not support the overwrite sudo command anymore.
sudo brew link --overwrite imagemagick
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.

Related

Permission denied installing sudo brew node for odoo 9 on macOS Sierra

Im trying to install Odoo v9 on macOS Sierra. I got it installed under virtualenv but when I run it (odoo.py) I get a Could not execute command lessc. I found this:
https://dedyyuristiawan.blogspot.com/2016/07/installation-odoo-on-mac-os-x-error.html
but when i try to run sudo brew ... I get this error:
Error : Running Homebrew as root is extremely dangerous and no longer supported.
I ran it without sudo but I get:
Error: Permission denied - usr/local/lib/node_modules/npm/.github/issue_template.md
When I run brew doctor I get:
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Users/mars/odoo-env/bin/python-config
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  node
So I ran this:
(odoo-env) Marcios-MacBook-Pro:odoo mars$ brew cleanup
(odoo-env) Marcios-MacBook-Pro:odoo mars$ brew link node
Linking /usr/local/Cellar/node/7.2.0...
Error: Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
  rm '/usr/local/bin/node'
To force the link and overwrite all conflicting files:
  brew link --overwrite node
To list all files that would be deleted:
  brew link --overwrite --dry-run node
(odoo-env) Marcios-MacBook-Pro:odoo mars$ brew cleanup
(odoo-env) Marcios-MacBook-Pro:odoo mars$ brew link node
Linking /usr/local/Cellar/node/7.2.0...
Error: Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
  rm '/usr/local/bin/node'
To force the link and overwrite all conflicting files:
  brew link --overwrite node
To list all files that would be deleted:
  brew link --overwrite --dry-run node
Anyone know a workaround?
Execute this and youre fine:
sudo chown -R $(whoami):admin /usr/local/lib/node_modules/

I've already installed binutils in osx 10.11, but objdump still doesn't work

I've tried hard to install binutil with HomeBrew onto osx 10.11, finally succeed, but objdump still doesn't work. The response given by terminal is as follow:
MacBook-Pro:~ Mars$ brew install binutils
==> Downloading https://homebrew.bintray.com/bottles/binutils-2.26.el_capitan.bo
Already downloaded: /Library/Caches/Homebrew/binutils-2.26.el_capitan.bottle.tar.gz
==> Pouring binutils-2.26.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/binutils/2.26: 109 files, 140.3M
MacBook-Pro:~ Mars$ objdump
-bash: objdump: command not found
Anybody can help?
To avoid conflicts with the utilities distributed by Apple, the binutils executables installed by Homebrew all have "g" prefixed to their names (so, for instance, objdump becomes gobjdump).
you need to update your $PATH to include the homebrew install location. you probably want to look at other places people have asked this question like:
https://superuser.com/questions/324616/how-should-i-set-the-path-variable-on-my-mac-so-the-hombrew-installed-tools-are

How to link ntfs-3g with homebrew?

Forgive me if this is elsewhere, but I can't find it.
I am trying to install NTFS-3G on OS X 10.11 (El Capitan).
I am following the process at this link
But the step to install NTFS-3G reports:
$ brew install homebrew/fuse/ntfs-3g
Warning: homebrew/fuse/ntfs-3g-2015.3.14 already installed, it's just not linked
So...
How do I just link the installed item?
Once that's done, how do I complete the install process? Is there anything that the 'brew install...' process would do after linking?
EDIT:
Following bfontaine... I get:
$ brew link homebrew/fuse/ntfs-3g
Linking /usr/local/Cellar/ntfs-3g/2015.3.14...
Error: Could not symlink share/doc/ntfs-3g/README
Target /usr/local/share/doc/ntfs-3g/README
already exists. You may want to remove it:
rm '/usr/local/share/doc/ntfs-3g/README'
To force the link and overwrite all conflicting files:
brew link --overwrite ntfs-3g
To list all files that would be deleted:
brew link --overwrite --dry-run ntfs-3g
$ brew link --overwrite homebrew/fuse/ntfs-3g
Linking /usr/local/Cellar/ntfs-3g/2015.3.14...
Error: Could not symlink share/doc/ntfs-3g/README
/usr/local/share/doc/ntfs-3g is not writable.
Am I going down a hole? If I brew uninstall, will it clean everything up, or do I have to manually clean it up?
This is getting messy...
EDIT2:
The output of brew link --overwrite --dry-run is:
$ brew link --overwrite --dry-run homebrew/fuse/ntfs-3g
Would remove:
/usr/local/include/ntfs-3g/acls.h
/usr/local/include/ntfs-3g/attrib.h
/usr/local/include/ntfs-3g/attrlist.h
/usr/local/include/ntfs-3g/bitmap.h
/usr/local/include/ntfs-3g/bootsect.h
/usr/local/include/ntfs-3g/cache.h
/usr/local/include/ntfs-3g/collate.h
/usr/local/include/ntfs-3g/compat.h
/usr/local/include/ntfs-3g/compress.h
/usr/local/include/ntfs-3g/debug.h
/usr/local/include/ntfs-3g/device.h
/usr/local/include/ntfs-3g/device_io.h
/usr/local/include/ntfs-3g/dir.h
/usr/local/include/ntfs-3g/ea.h
/usr/local/include/ntfs-3g/efs.h
/usr/local/include/ntfs-3g/endians.h
/usr/local/include/ntfs-3g/index.h
/usr/local/include/ntfs-3g/inode.h
/usr/local/include/ntfs-3g/ioctl.h
/usr/local/include/ntfs-3g/layout.h
/usr/local/include/ntfs-3g/lcnalloc.h
/usr/local/include/ntfs-3g/logfile.h
/usr/local/include/ntfs-3g/logging.h
/usr/local/include/ntfs-3g/mft.h
/usr/local/include/ntfs-3g/misc.h
/usr/local/include/ntfs-3g/mst.h
/usr/local/include/ntfs-3g/ntfstime.h
/usr/local/include/ntfs-3g/object_id.h
/usr/local/include/ntfs-3g/param.h
/usr/local/include/ntfs-3g/realpath.h
/usr/local/include/ntfs-3g/reparse.h
/usr/local/include/ntfs-3g/runlist.h
/usr/local/include/ntfs-3g/security.h
/usr/local/include/ntfs-3g/support.h
/usr/local/include/ntfs-3g/types.h
/usr/local/include/ntfs-3g/unistr.h
/usr/local/include/ntfs-3g/volume.h
/usr/local/include/ntfs-3g/xattrs.h
/usr/local/share/man/man8/mkfs.ntfs.8 -> /usr/local/share/man/man8/mkntfs.8
/usr/local/share/man/man8/mkntfs.8
/usr/local/share/man/man8/mount.lowntfs-3g.8 -> /usr/local/share/man/man8/ntfs-3g.8
/usr/local/share/man/man8/mount.ntfs-3g.8 -> /usr/local/share/man/man8/ntfs-3g.8
/usr/local/share/man/man8/ntfs-3g.8
/usr/local/share/man/man8/ntfs-3g.probe.8
/usr/local/share/man/man8/ntfs-3g.secaudit.8
/usr/local/share/man/man8/ntfs-3g.usermap.8
/usr/local/share/man/man8/ntfscat.8
/usr/local/share/man/man8/ntfsclone.8
/usr/local/share/man/man8/ntfscluster.8
/usr/local/share/man/man8/ntfscmp.8
/usr/local/share/man/man8/ntfscp.8
/usr/local/share/man/man8/ntfsfix.8
/usr/local/share/man/man8/ntfsinfo.8
/usr/local/share/man/man8/ntfslabel.8
/usr/local/share/man/man8/ntfsls.8
/usr/local/share/man/man8/ntfsprogs.8
/usr/local/share/man/man8/ntfsresize.8
/usr/local/share/man/man8/ntfsundelete.8
/usr/local/lib/libntfs-3g.86.dylib
/usr/local/lib/libntfs-3g.a
/usr/local/lib/libntfs-3g.dylib -> /usr/local/lib/libntfs-3g.86.dylib
/usr/local/lib/pkgconfig/libntfs-3g.pc
$
but even after 'brew uninstall...' the directory /usr/local/include/ntfs-3g still exists
Use brew link homebrew/fuse/ntfs-3g.
To go further here are the common commands relevant here:
brew install <formula> # install (and link) the formula
brew unlink <formula> # unlink the formula
brew link <formula> # link the formula
brew uninstall <formula> # uninstall (and unlink) the formula
To understand this you need to know that when Homebrew installs a formula foo version 1.2.3, it installs everything under /usr/local/Cellar/foo/1.2.3/ then symlinks all binaries in /usr/local/bin; all manpages under /usr/local/share/man; etc. This means that /usr/local/bin/something is not a binary but a symlink to the relevant binary (e.g. /usr/local/Cellar/foo/1.2.3/bin/something).
Sometimes binaries conflict with each other. For example both mysql and mariadb provide a mysql binary. Homebrew won’t be able to link both at the same time so it allows you to install one; unlink it; then install the other. That way you can have both on your system without conflict.

"Unlinked kegs in your Cellar". How do I remove them?

After installing and uninstalling some programs through brew and brew cask, now I get brew doctor saying "unlinked kegs in your Cellar".
It suggests to link them, to avoid build trouble with later brews, but instead I'd rather delete them, as they're leftovers from brew programs or formulas that I don't use anymore.
How or where do I remove these? (I don't even know what a keg, or the Cellar, is)
Run:
brew remove packageName
for each unlinked package.
2018 Update
$ brew link --help
If --overwrite is passed, Homebrew will delete files which already exist
in the prefix while linking.
$ brew link --overwrite [package]
$ brew doctor
running brew link will bring up optional commands that you can use, along with that you'll need an argument to go with it or it'll prompt you with an error saying just that.
so I would suggest running:
brew doctor
This will give you the:
'Warning: You have unlinked kegs in your Cellar...'
message
underneath this message it will prompt which kegs are there with the potential problem.
My personal warning was:
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
mongodb
brew link
read your options, so you understand what is happening with this command.
brew link --dry-run <yourArgument>
Homebrew will list all files which would be linked or which would be deleted by brew link --overwrite, but will not actually link or delete any files.
brew link --overwrite <yourArgument>
This will execute what the dry-run did, for real this time.
My experience with this was:
cli cmnd:brew link --overwrite mongodb
cli response: Linking /usr/local/Cellar/mongodb/3.2.7... 0 symlinks created
brew doctor
Finally I ran this command and my response no longer had issues.
cli response: Your system is ready to brew.
I figure it will either make the link or if there is none to be had it will just delete the file; which was a previous solution above (this just seems to follow the brew cli prompts vs. just "smashing" the issue with a hammer).
I hope this helps you!
don't cry over spilt code, keep supporting the community.
After installing homebrew on Mac I had the following error:
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
libtool
libksba
libyaml
libgpg-error
After running brew link libtool I would get the following error:
$ brew link libtool
Linking /usr/local/Cellar/libtool/2.4.6_1...
Error: Could not symlink include/libltdl
/usr/local/include is not writable.
But as it turned out I didn't have a folder /usr/local/include at all.
So I created it. And then changed the owner and group of the new folder to match the other folders in /usr/local. The next error was the same for /usr/local/lib, so I followed the same process.
After creating those two folders, brew link [package] worked.
brew 1.9.0
brew cleanup [options] [formula|cask]
Remove stale lock files and outdated downloads for all formulae and casks, and
remove old versions of installed formulae. If arguments are specified, only do
this for the given formulae and casks.
--prune Remove all cache files older than specified
days.
-n, --dry-run Show what would be removed, but do not
actually remove anything.
-s Scrub the cache, including downloads for
even the latest versions. Note downloads
for any installed formula or cask will
still not be deleted. If you want to delete
those too: rm -rf "$(brew --cache)"
--prune-prefix Only prune the symlinks and directories
from the prefix and remove no other files.
-v, --verbose Make some output more verbose.
-d, --debug Display any debugging information.
-h, --help Show this message.
Older versions
brew prune [--dry-run]:
Remove dead symlinks from the Homebrew prefix. This is generally not
needed, but can be useful when doing DIY installations. Also remove broken
app symlinks from /Applications and ~/Applications that were previously
created by brew linkapps.
If --dry-run or -n is passed, show what would be removed, but do not
actually remove anything.
rm /usr/local/Library/Taps/josegonzalez
-or if you are frightened-
mv /usr/local/Library/Taps/josegonzalez /usr/local/Library
Alike for other conflicting, but unlinked kegs/taps.
You can also use the provided info from the console and link them again:
Run `brew link`
Do this for each item listed, and everything should be fixed soon.

Homebrew - repeated "linking" bug. What is the underlying issue here?

So I've been using homebrew to install various packages/libraries/programs on my mac. I keep running into a problem in which homebrew tells me that I have unlinked kegs in my Cellar.
For instance, upon running brew install phantomjs I received the following message:
Warning: Could not link phantomjs. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link phantomjs'
Possible conflicting files are:
/usr/local/bin/phantomjs -> /usr/local/lib/node_modules/phantomjs/bin/phantomjs
I tried running brew link phantomjs as recommended, and hit a similar problem:
Error: Could not symlink file: /usr/local/Cellar/phantomjs/1.9.2/bin/phantomjs
Target /usr/local/bin/phantomjs already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
brew link --overwrite formula_name
The command brew link --overwrite --dry-run phantomjs gives the following message:
Would remove:
/usr/local/bin/phantomjs -> /usr/local/lib/node_modules/phantomjs/bin/phantomjs
I will probably go ahead and overwrite, but this appears to happen every time I try to install something with homebrew. Why? Why isn't homebrew working as expected?
Thanks.
From what I can tell, looks like you have previously done:
% sudo npm install -g phantomjs
In this case, you should do the following:
% sudo npm uninstall -g phantomjs
% brew link --overwrite phantomjs
I thought I'd take a crack at this. I ran into a similar problem today, and I think it may be related to this:
https://github.com/Homebrew/homebrew/issues/22408
Long story short, I think it has to do with how npm manages packages vs how brew does it. (I'm assuming you installed node with its defaults, which would have given you npm).
At some point you probably installed some package with npm. Maybe grunt, karma, etc..those by default end up in /usr/local/lib/node_modules.
Maybe one of those packages or its dependencies(or sub-dependencies) depended on phantomjs (I think Karma might use phantomjs?) Anyways, if now you are trying to brew install phantomjs, which is trying to make a symlink to it, that may be conflicting with the already existing symlink that npm created for you..
I think you can change the symlink path for that package so that brew permanently points to that already installed package in the node_modules folder. Sorry not to be more specific, I'm just figuring this out myself.

Resources