Unable to brew link qt - macos

So I just installed qt via brew in Mac OS X. It was unable to link it however.
When I try to run brew link qt or brew link --overwrite qt I get back the following:
tonybeninate$ brew link --overwrite qt
Linking /usr/local/Cellar/qt/4.8.4... Warning: Could not link qt. Unlinking...
Error: Directory not empty - /usr/local/opt/qt
Anyone have any suggestions? I've also tried running brew link -n qt and removing any files/dirs that were conflicting to no avail.

Try brew cleanup.
Even with above command, you might get similar error. To fix it, change permissions with
sudo chown -R $(whoami) /usr/local
If you are on Mac High Sierra, use
sudo chown -R $(whoami) $(brew --prefix)/*
Follow this post for more permissions related changes
Once permissions are done, try brew cleanup and your command brew link --overwrite qt

Related

Homebrew: Could not symlink, /usr/local/share/man/man7 is not writable

I'm installing LightGBM on OSX, following the installation guide. While installing cmake, Homebrew gives such warning message:
Warning: cmake-3.8.1 already installed, it's just not linked.
Then I try:
$brew link cmake
it gives:
Linking /usr/local/Cellar/cmake/3.8.1...
Error: Could not symlink share/man/man7/cmake-buildsystem.7
/usr/local/share/man/man7 is not writable.
The proposition of Mark Setchell to use sudo chown -R $(whoami):admin /usr/local/share/man is right. According to the Homebrew troubleshooting page:
If commands fail with permissions errors, check the permissions of /usr/local’s subdirectories. If you’re unsure what to do, you can run cd /usr/local && sudo chown -R $(whoami) bin etc include lib sbin share var Frameworks
but the proposition of Nano to use sudo is not a good one. According to the Homebrew FAQ:
Homebrew is designed to work without using sudo. You can decide to use it but we strongly recommend not to do so. If you have used sudo and run into a bug then this is likely to be the cause. Please don’t file a bug report unless you can reproduce it after reinstalling Homebrew from scratch without using sudo.
Just follow these 4 steps
sudo chown -R $(whoami) $(brew --prefix)/*
brew doctor
brew prune
brew link cmake

Install git via homebrew on mac osx 10.10 results in: Error: Permission denied - /usr/local/lib/perl5/site_perl/5.18.2

Hi I just tried installing git via homebrew on my mac - something is wrong. I had the github for mac app installed, but I tried removing that. The current git version in my system is:
Nielsk#~: $ git --version
git version 1.9.3 (Apple Git-50)
This is what happens if I try to install git via homebrew:
Nielsk#~: $ brew install git
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-2.1.3.y
######################################################################## 100,0%
==> Pouring git-2.1.3.yosemite.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain
The 'contrib' directory has been installed to:
/usr/local/share/git-core/contrib
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completion has been installed to:
/usr/local/share/zsh/site-functions
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied - /usr/local/lib/perl5/site_perl/5.18.2
Error: Permission denied - /usr/local/lib/perl5/site_perl/5.18.2
How can I solve this?
I also met the same issue. I think we should change the readable permission to make sure any of the directories is readable by "all". So I tried the command: sudo chown -R $USER:admin /usr/local
and then: brew link --overwrite git It works for me, hope it will also work for you.
From High Sierra, chown of /usr/local is not allowed. However you can still change permission the sub directories in /usr/local.
In my case, I had to create Frameworks in /usr/local and sudo chown -R $(whom) Frameworks. After that follow what brew doctor says.
The better way is to create subdirectory whatever you need and run
sudo chown -R $(whoami) $(brew --prefix)/*
For those with the new El Capitan OS, you'll need to update your permissions:
Open Terminal and type the following commands:
$ sudo chown -R $(whoami):admin /usr/local
$ brew doctor
$ brew update
$ brew link --overwrite git
The above solution will work for other brew installs like node, etc. Just replace the last line if you started the installation but encountered errors during the brew installation.
I had a similar permission denied error on install of git until I cleaned things up:
$brew doctor
..... << long output of issues, so you run:
$brew prune
$brew doctor
..... << less issues now, so manually clean up
$brew update
$brew install git
Does that address your error as well?
I did what brew doctor recommended and it helped:
sudo mkdir -p /usr/local/sbin
sudo chown -R $(whoami) /usr/local/sbin
MacOS 10.14.4

Ghostscript not writable

Trying to install octave on a new Macbook, but keep running into problems using Homebrew. I am following directions here:
http://wiki.octave.org/Octave_for_MacOS_X
I run into the error:
Linking /usr/local/Cellar/ghostscript/9.14...
Error: Could not symlink share/ghostscript/Resource
/usr/local/share/ghostscript is not writable.
After entering:
sudo chown -R username:admin /usr/local/bin
brew link ghostscript
I still get the same error. How do I make ghostscript writable?
Using this command worked for me:
sudo chown -R `whoami` /usr/local/share/ghostscript
After that it was possible to create the symlink with:
brew link --overwrite ghostscript
Notice that /usr/local/share is outside /usr/local/bin.
Try sudo chown -R username:admin /usr/local.

Qmake installed but not linked - Using Brew - Mac

I have installed Qmake using brew.
brew install qt
The results which the terminal brings is:
Warning: qt-4.8.6 already installed, it's just not linked
This is a problem with brew to install correct the things? because I am having the same "not linked" problem with PostgreSQL.
Thks
I found the problem:
The Brew can't write to the folder /usr/local/lib/
So I used the command: sudo chown -R $USER /usr/local/lib
I found a similar error here: Brew doctor says: "Warning: /usr/local/include isn't writable."
But this problem was with another folder permission.
The Brew can't write to the folder
/usr/local/lib/
So I used the command:
sudo chown -R $USER /usr/local/lib
After need uninstall and install qt again. (If you run reinstall the problem will continuous)
brew uninstall qt
brew install qt
I found a similar error here:
Brew doctor says: “Warning: /usr/local/include isn't writable.”
But this problem was with another folder permission.
Try
brew link qt
Which should tell brew to link the package.
If that doesn't work, someone else had a similar problem here: Error: The 'brew link' step did not complete successfully

Homebrew link issue on Mac OS X (10.7.5)

I'm having issues troubleshooting a link problem when installing Homebrew. I'm attempting to install it on Mac OS X (10.7.5). I have been unable to find a solution and could use help. The error I'm receiving is below.
tone$ brew link wget
Linking /usr/local/Cellar/wget/1.14... Warning: Could not link wget. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/wget/1.14/share/man/man1/wget.1
Target /usr/local/share/man/man1/wget.1 already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
brew link --overwrite formula_name
To list all files that would be deleted:
brew link --overwrite --dry-run formula_name
I ran the following commands to get to this point
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
$ brew install wget

Resources