EzDevInfo.com

homebrew interview questions

Top homebrew frequently asked interview questions

How do I restart redis that I installed with brew?

I used brew to install redis (a key/value store database server) for my node.js app.

brew install redis

However, it seems to disappear and is very volatile. Because I'm using redis as my session store, I need to be able to quickly restart it on my mac when this happens.

How do I restart redis that I installed with brew?


Source: (StackOverflow)

is there any equivalent/branch of Homebrew for Windows? [duplicate]

Possible Duplicate:
Package managers for Windows

Homebrew is a package manager for macOS mimicking Linux ones (think about apt-get as a canonical example). Obviously, it has some trendy features, like the total git integration.

however, I was asking myself if there was any branch of Homebrew for Windows platform and, if not, any equivalent (that's to say an apt-get like).


Source: (StackOverflow)

Advertisements

How can I remove outdated installed versions of Homebrew packages?

How can I remove outdated versions of Homebrew packages that are installed side-by-side with current versions?


Source: (StackOverflow)

How do you re-install a package with Homebrew (Mac)?

Struggling to find good Homebrew documentation (or tutorial)...

In the mean time I need to reinstall ImageMagick that was installed with Homebrew (brew install imagemagick) and not sure if I should first brew uninstall imagemagick or go ahead and brew install imagemagick --disable-openmp --force over the existing installation?!?

what does --force actually do? is it effectively a uninstall followed by a new install with new parameters?


Source: (StackOverflow)

Homebrew installation of git won't take precedence over system version (in /usr/bin/)

OS X (or Xcode) comes bundled with git 1.7.something, but after brew install git (1.8.0), which git keeps returning the old /usr/bin/git.

This is what I get when I echo $PATH right now:

/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin

Shouldn't Homebrew stuff take precedence?

Also, I've no idea where that usr/local/git/bin comes from at the end.


Source: (StackOverflow)

Homebrew vs Fink vs Macports? [closed]

I am using Fink to install Unix apps on my mac, I just came across Homebrew and saw some good reviews about Homebrew.

So, my question is:

  1. What package manager do you guys use for Mac?
  2. I use Fink currently, so will the shift from Fink to Homebrew be really worth it?
  3. If 2. is true, then why?

Source: (StackOverflow)

Mac Homebrew and Wireshark

I've installed Wireshark(.org) using Homebrew.

brew install wireshark

at the end the script says

==> ./configure --prefix=/usr/local/Cellar/wireshark/1.2.7 --disable-dependency-tracking --disable-wireshark
==> make
==> make install
==> Caveats
We don't build the X11 enabled GUI by default
==> Summary
/usr/local/Cellar/wireshark/1.2.7: 167 files, 50M, built in 5.4 minutes

I'm not able to find the 'wireshark' GUI.
Any idea of how to build it?

Thanks


Source: (StackOverflow)

How can Homebrew print a beer mug in Terminal?

Homebrew has a neat trick of printing out little icons next to its output. Like this:

brew icons in terminal output

If I copy paste the icon it on its own and hit enter I get the result:

-bash: $'?\237\215?': command not found

And if I try it with echo or printf I just get ????. Same if I escape all the quotes and $s etc.

editron:~ stib$ echo $'?\237\215?'
????

So how do they do that? What do the magic characters $'?\237\215?' mean?


Source: (StackOverflow)

OS X Yosemite - Too many files open

I recently upgraded from Mavericks to Yosemite....headaches ensued

I'm pretty sure my problem lies w/ the number of files I can open - but I'm not sure how to solve it. I'm also pretty sure I've read every article/tip about creating the /etc/sysctl.conf file and /etc/launchd.conf file

For clarity's sake this is what both of them currently look like n.b. (I'm not even sure if these are the right commands to put in them anymore - I've tried just about everything and every combination. ie: higher values, lower values, removing commands, adding commands)

/etc/launchd.conf

limit maxfiles 16384 32768
limit maxproc 1000 2000

/etc/sysctl.conf

# Turn up maxproc
kern.maxproc=2048
# Turn up the maxproc per user
kern.maxprocperuid=512

I've also tried increasing my ulimit values - both globally and locally for my current session...no bueno

ulimit -a

-t: cpu time (seconds)              unlimited
-f: file size (blocks)              unlimited
-d: data seg size (kbytes)          unlimited
-s: stack size (kbytes)             8192
-c: core file size (blocks)         0
-v: address space (kbytes)          unlimited
-l: locked-in-memory size (kbytes)  unlimited
-u: processes                       709
-n: file descriptors                4096

Ok - this is where my headache initially started...My DB (percona-server 5.6.21-69.0 installed via homebrew) started choking and dying, and in the mysql-error.log it was filled w/ the error too many files open.

2014-10-21 15:19:50 5190 [ERROR] /usr/local/Cellar/percona-server/5.6.21-69.0/bin/mysqld: Can't open file: './ie/tokenorder_products.frm' (errno: 24 - Too many open files)
2014-10-21 15:19:50 5190 [ERROR] /usr/local/Cellar/percona-server/5.6.21-69.0/bin/mysqld: Can't open file: './ie/tokenorders.frm' (errno: 24 - Too many open files)
2014-10-21 15:19:50 5190 [ERROR] /usr/local/Cellar/percona-server/5.6.21-69.0/bin/mysqld: Can't open file: './ie/tsdevices.frm' (errno: 24 - Too many open files)
2014-10-21 15:19:50 5190 [ERROR] /usr/local/Cellar/percona-server/5.6.21-69.0/bin/mysqld: Can't open file: './ie/tsracks.frm' (errno: 24 - Too many open files)
2014-10-21 15:19:50 5190 [ERROR] /usr/local/Cellar/percona-server/5.6.21-69.0/bin/mysqld: Can't open file: './ie/v_classunity_classlist.frm' (errno: 24 - Too many open files)
2014-10-21 15:20:48 5190 [ERROR] Error in accept: Too many open files

This is where I initially started to try and solve that problem by "up-ing" my ulimit, maxfiles, maxproc,etc...

Eventually - frustrated, I moved on and would come back to that issue later. So then I was trying to sudo gem install nokogiri and over and over it would fail and spit out this same error (a lot of repeats about the builder.rb failing to build the gem native extension - followed by a bunch of repeated stacktraces Logs Gist

nokogiri Install Errors nokogiri install errors

I've tried/googled a bunch of different approaches to solve this issue (ie: additional flags, etc..). Whats amazing - and when I started thinking this issue was tied to the # of files/processes open is when I checked top while the gem was installing....I was pretty surprised to see what I found

top during gem install nokogiri sudo gem install nokogiri

It looks like my process keeps forking, which then made sense for this ONE line in my previous picture (see "nokogiri install errors picture")

sh: fork: Resource temporarily unavailable

So I'm kinda out of ideas, but I'm not really sure how to debug the # of files anymore?

UPDATE

Well, I managed to get nokogiri installed. Unfortunately, I'm not exactly sure what fixed it b/c I've tried so many things. But I think it had to deal w/ reinstalling ruby. However, I'm still getting the same issue w/ my DB complaining about too many files open when I use any sort of database that is not trivially small.


Source: (StackOverflow)

Homebrew won't link git

When I installed git or upgrade git via brew I couldn't link it with brew link git. If I try sudo brew link git I get:

cowardly refusing to sudo brew link

It says that I have to check the permissions on:

/usr/local/share/gitk/lib
/usr/local/share/git-gui/lib
/usr/local/share/git-core/templates
/usr/local/share/git-core/templates/hooks
/usr/local/share/git-core

I chmoded everything to 777 but I'm not sure if it is good.

I can now link git. Should I change the permission to something less permissive?


Source: (StackOverflow)

Installing Homebrew packages without linking

I'd like to install several versions of Ruby (or really any Homebrew package) without linking any of them. Basically, I'd like to treat any formula as keg-only.

I can't seem to find a way to do this, although it seems trivial. I thought there'd be something like brew install --no-link <formula>.

Is there a way to do what I want, or some reason why this is a bad idea?

I'd really like to use Homebrew to install Ruby versions, and rbenv to manage them.


Source: (StackOverflow)

Can I install Homebrew without sudo privileges?

Homebrew nicely allows package installations without sudo privileges, but it seems that I need admin privileges to install Homebrew itself.

I'd like to install Homebrew in a Mac environment where I don't have sudo or admin privileges. Is this possible?


Source: (StackOverflow)

MySQL Preference Pane control for MySQL installed via Homebrew

this is a repost of my question at apple.stackexchange.com

I have installed MySQL via homebrew: brew install mysql. I'd like to get the MySQL preference pane hooked up to my installation of MySQL through homebrew. How can I achieve this?


Source: (StackOverflow)

How to install matplotlib on OS X?

I want to install matplotlib on OS X. If possible, using homebrew.

I installed Python 2.7.1 using brew install python, I modified my path to use it
I installed pip using brew install pip
I installed numpy 1.5.1 using pip install numpy
I installed scipy 0.8.0 using pip install scipy

This is where it gets hairy. pip install matplotlib will fetch the wrong version of matplotlib, which is incompatible with the recent version of numpy.

The solution is to fetch the correct version of matplotlib manually:

pip install -f http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz matplotlib

But, that version fails to compile since it can't find the freetype headers:

In file included from src/ft2font.cpp:1:
src/ft2font.h:14:22: error: ft2build.h: No such file or directory

These headers are actually installed in /usr/X11/include as part of the X11 developer tools.

So, how can I make matplotlib use these headers?


Source: (StackOverflow)

Errors in Homebrew on OS X Lion

I just ran the Homebrew script as described in the installation page. I then ran brew doctor in Terminal, and it returned several errors. I'm not sure how to fix those errors, please help.

brew doctor

Error: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:

    /usr/local/share/man/de
    /usr/local/share/man/de/man1
Error: You have Xcode 4.2, which is outdated.
Please install Xcode 4.3.
Error: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libcdt.5.dylib    /usr/local/lib/libcgraph.6.dylib    /usr/local/lib/libgraph.5.dylib    /usr/local/lib/libgvc.6.dylib    /usr/local/lib/libgvpr.2.dylib    /usr/local/lib/libpathplan.4.dylib    /usr/local/lib/libxdot.4.dylib
Error: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/libcdt.pc    /usr/local/lib/pkgconfig/libcgraph.pc    /usr/local/lib/pkgconfig/libgraph.pc    /usr/local/lib/pkgconfig/libgvc.pc    /usr/local/lib/pkgconfig/libgvpr.pc    /usr/local/lib/pkgconfig/libpathplan.pc    /usr/local/lib/pkgconfig/libxdot.pc
Error: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

    2to3

Consider amending your PATH so that /usr/local/bin
is ahead of /usr/bin in your PATH.

Source: (StackOverflow)