How to fix Homebrew in High Sierra? - homebrew

Couldn't find a question specifically dealing with this problem in OS X High Sierra. As I still struggle to find a solution that works for me I think it is a good idea to separate old answers from new ones.
So, the problem:
$brew install wget
Error: Could not create /usr/local/Cellar
Check you have permission to write to /usr/local
I tried:
sudo chown -R $(whoami) $(brew --prefix)/*
But this leaves me with the same error.

Related

Install MacVim in Sierra

I have a new laptop with Sierra. I brought my applications from my old mac with Time Machine and most of them are working fine. However, Macvim disappeared. I tried to install it.
I tried to re-install it by installing Homebrew and brew installing macvim. The install looks successful, but I still cannot find nor use macvim. I guess this is a matter again of application files no longer being in /usr/ but in Library/, but honestly I am a bit lost as to how to figure out whether this is the problem and how to fix it.
Can you please help me out with this?
How I installed Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
How I installed Macvim:
brew install macvim
MacVim is keg-only.
If you run this command after installation:
brew linkapps
you will find MacVim in your Applications folder in finder.
Since linkapps is now deprecated, I've had to manually link .app via
ln -Fs `find /usr/local -name "MacVim.app"` /Applications/MacVim.app
Unfortunately, Spotlight cannot find MacVim this way. Therefore, I've (after opening the app by double-clicking on the icon in Finder's Applications folder) right-clicked on the app's icon on the dock and selected Option -> Keep in Dock.
The symbolic soft link solution described by #laylaylom works; but I am having trouble setting MacVim as my default app for some filetype. Then I found this from here:
% mkdir ~/Applications/Emacs.app
% ln -s /usr/local/Cellar/emacs/23.2/Emacs.app/Contents ~/Applications/Emacs.app
That solution was for Emacs.app but it can work with MacVim as well:
% mkdir ~/Applications/MacVim.app
% ln -Fs /usr/local/Cellar/macvim/8.1-151/MacVim.app/Contents ~/Applications/MacVim.app
There is now a cask for MacVim, but it's not the default. The correct command is:
brew install homebrew/cask/macvim
This will install MacVim in the Applications folder, and make it available to Spotlight.

Homebrew error installing tomcat

After installing tomcat on Os x El Capitan using Homebrew I have received the following Warning:
your HOMEBREW_PREFIX is set to /usr/local but HOMEBREW_CELLAR is set
to /usr/local/Cellar. Your current HOMEBREW_CELLAR location will stop
you being able to use all the binary packages (bottles) Homebrew
provides. We recommend you move your HOMEBREW_CELLAR to
/usr/local/Cellar which will get you access to all bottles."
The command brew services list shows no services installed.
Printenv doesn't show any homebrew variable
It's not clear to me what should I do.
enter link description here
I also encountered this problem, in the end of the page to get accurate help,
brew bundle dump
rm -rf /usr/local/Homebrew/Cellar
brew bundle
I have received a similar warning when I tried to do a brew update.
It did not allow me to update. All I have done to resolve it was do a brew update in going to the /usr/local/Cellar directory.
From what I understand HOMEBREW_REPOSITORY path was modified or went missing when the OS was updated. After the brew update, the message said
Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
return /usr/local to its default ownership with:
sudo chown root:wheel /usr/local
This got me back to my normal brew usage with out a problem.

How to completely uninstall opencv ubuntu?

I am installing caffe and I think I screwed up my install by having multiple versions of OpenCV. Now i don't know what i did on my own but nothing seems to work right. So my safest bet is to do a complete utter uninstall of opencv. How do i do that help thanks ?
I would like to install python after that using conda
I followed this thread Removing all installed OpenCV libs
although when i typed $> sudo find / -name "*opencv*" -exec rm -i {} \;
ubuntu still keeps asking me for permission to remove every file which is annoying. how do i tell ubuntu to remove it all ?
If you installed OpenCV using CMake then there should be an uninstall file in the same location as the install file, just run sudo make uninstall.
remove the -i option. -i option stands for "interactive"

libMagickCore.so.4: cannot open shared object file: No such file or directory

I am facing is issue in my rails 3.2.17 application. I have install rmagick 2.13.2 ImageMagick 6.7.7-10 in my ubuntu machine. I did locate libMagick and I found the below list:
$ locate libMagick
/usr/lib/x86_64-linux-gnu/libMagickCore.a
/usr/lib/x86_64-linux-gnu/libMagickCore.la
/usr/lib/x86_64-linux-gnu/libMagickCore.so
/usr/lib/x86_64-linux-gnu/libMagickCore.so.5
/usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0
/usr/lib/x86_64-linux-gnu/libMagickWand.a
/usr/lib/x86_64-linux-gnu/libMagickWand.la
/usr/lib/x86_64-linux-gnu/libMagickWand.so
/usr/lib/x86_64-linux-gnu/libMagickWand.so.5
/usr/lib/x86_64-linux-gnu/libMagickWand.so.5.0.0
RMagick2.so is depends on libMagickCore.so.4, but you don't have it.
For workaround try this:
sudo ln -s /usr/lib/x86_64-linux-gnu/libMagickCore.so.5 /usr/lib/x86_64-linux-gnu/libMagickCore.so.4
sudo ln -s /usr/lib/x86_64-linux-gnu/libMagickWand.so.5 /usr/lib/x86_64-linux-gnu/libMagickWand.so.4
sudo ldconfig
If this does not work, probably, you need earlier version of ImageMagick.
Finally I could find the solution. Hope this may help others also. Actually "libmagickcore4" libs was missing. So install it using below command.
sudo apt-get install libmagickcore4

RVM hangs on 'Installing required packages' on Debian

I installed rvm on debian 7 using the command:
\curl -L https://get.rvm.io | bash -s stable --rails
from this article:
https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-an-debian-7-0-wheezy-vps-using-rvm
I get this output:
Searching for binary rubies, this might take some time.
Found remote file https://rvm.io/binaries/debian/7/x86_64/ruby-2.1.0.tar.bz2
Checking requirements for debian.
Installing requirements for debian.
Updating system...
Installing required packages: gawk, g++, libreadline6-dev, zlib1g-dev, libssl-dev, libyaml-dev, libsqlite3-dev, sqlite3, autoconf, libgdbm-dev, libncurses5-dev, automake, libtool, bison, pkg-config, libffi-dev
It hangs here forever. I tried waiting about 30 min. I also tried hitting ctrl-c and running some rvm commands. rvm list known works fine, but rvm install gets me back to the same "installing requirements" and it hangs as well.
Any ideas? Googleing only seemed to bring up issues involving OSX (I'm using debian in a vbox in windows 8).
Would installing each required package indiviually via apt-get be the best move?
I faced the same issue. To resolve, just mount the installation CD that you used to install Debian and it will work.
I encountered the same issue with Debian 8. As it turns out, the installation was looking for the required packages on the Debian install CD-ROM, which wasn't inserted. To fix this, run the following command:
nano /etc/apt/sources.list
Then, comment out the line beginning with "cdrom" so that it looks like the following:
# cdrom:[Debian GNU/Linux...
You should be able to run sudo apt-get update then try installing rvm again. However, I restarted my laptop before doing so. Therefore, I can't give 100% confirmation that it works without restarting.
As i've written in comment, try installing requirements by hand, sometimes something wilk silently fail and cause such issues. As OP found, the gawk package was causing the issue.
Just remove the cdrom entry from the sources.list file. This can be done easily:
sudo sed -i '/cdrom/d' /etc/apt/sources.list
This should take care of the problem. The message is because somehow you still have the cdrom entry in your sources.list file, you can check the content of the file using:

Resources