Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
@onggunhao
Copy link

onggunhao commented Jun 21, 2011

@JohnDCCIU: Thanks for the tip. However, I've been trying to put in the flag and it still doesn't seem to work at all!

Currently, I'm entering:

ruby -e "$(curl -fksSL https://raw.github.com/gist/323731)"

@JoshOldenburg
Copy link

JoshOldenburg commented Jul 17, 2011

Oh gosh. That was the easiest install EVER!!! One line and my password install a program is a first.

@kennethreitz
Copy link

kennethreitz commented Jul 17, 2011

JoshTheGeek =D

@mxcl
Copy link
Author

mxcl commented Aug 23, 2011

Yes there's a ticket for this. I'll revert the change for now. You can fix it quite easily by just changing the permissions on /usr/local. Update: script is updated. Including a fix for the curl SSL certificate.

@Theqweezy
Copy link

Theqweezy commented Sep 10, 2011

when I "brew install git" i get this:

curl: (22) The requested URL returned error: 503
Error: Failure while executing: /usr/bin/curl -f#LA Homebrew\ 0.8\ (Ruby\ 1.8.6-369;\ Mac\ OS\ X\ 10.5.8) http://kernel.org/pub/software/scm/git/git-1.7.6.1.tar.bz2 -o /Users/josephgutman/Library/Caches/Homebrew/git-1.7.6.1.tar.bz2 --insecure

@bobthecow
Copy link

bobthecow commented Sep 10, 2011

Most likely due to the fact that kernel.org is returning a 503 error when you try to download git...

http://kernel.org/pub/software/scm/git/git-1.7.6.1.tar.bz2

... kinda like it says in the error message :)

@Theqweezy
Copy link

Theqweezy commented Sep 11, 2011

ah yes, realizing that kernel is down

@alanjcfs
Copy link

alanjcfs commented Sep 12, 2011

When I tried to brew install mysql it gave me an error that it couldn't find /usr/local/Cellar. I had to mkdir /usr/local/Cellar to get it working. Should Cellar be created with this script or in one of the formulas?

@jazzido
Copy link

jazzido commented Oct 26, 2011

Got an error during install: /usr/local exists in the machine, but it doesn't contains all the subdirectories listed in chmods. That causes the sudo in line 113 to fail.

@halcyonCorsair
Copy link

halcyonCorsair commented Jan 17, 2012

Hi Max,

Please change abort unless getc == 13 to abort unless gets == "\n"

So that the install will work via fabric, etc!

@mxcl
Copy link
Author

mxcl commented Jan 17, 2012

@halcyonCorsair What's fabric? Why won't it work? What's etc?

@mxcl
Copy link
Author

mxcl commented Jan 17, 2012

@jazzido it checks if the directories exist on line 94. Error messages are more useful than inaccurate analysis. Thanks.

@Frungi
Copy link

Frungi commented Jan 17, 2012

@mxcl “Etc.” means “et cetera”, “and so on”, means things other than Fabric, whatever that is.

@adamv
Copy link

adamv commented Jan 17, 2012

Fabric is a Python-based ssh automation thingy: https://github.com/fabric/fabric

@mxcl
Copy link
Author

mxcl commented Jan 17, 2012

I wonder if there is any good reason I didn't use gets in the first place. I imagine there must be. It's not the kind of thing I'd do otherwise. Shame I didn't have the foresight to comment it :P

@mxcl
Copy link
Author

mxcl commented Jan 17, 2012

Aah. It's because of UX. if you press any other key it should immediately exit. gets requires you to press enter, which makes ineffective for the exit option for the instruction "Press enter to continue".

@halcyonCorsair
Copy link

halcyonCorsair commented Jan 18, 2012

Ok. In my quick tests, I'm getting

>> STDIN.getbyte

=> 10
>> 10.chr
=> "\n"
>> 13.chr
=> "\r"

Can we change the line to be:

i = getc
abort unless i == 13 or i == 13

Or am I off my rocker here?

@mxcl
Copy link
Author

mxcl commented Jan 18, 2012

Can we get an explanation of why it doesn't work so we can fix it more effectively?

@halcyonCorsair
Copy link

halcyonCorsair commented Jan 18, 2012

Oops, 2am typo there, what I meant was...

i = getc
abort unless i == 10 or i == 13

I have no idea why \r is getting sent instead of \n for me.

@mxcl
Copy link
Author

mxcl commented Jan 18, 2012

Modified. Thanks.

@sinisterchipmunk
Copy link

sinisterchipmunk commented Feb 15, 2012

Pull request: http://gist.github.com/1836995
Changed shebang to #!/usr/bin/env ruby so other rubies can be used (in case user has removed the default system ruby)

@nhooey
Copy link

nhooey commented Feb 21, 2012

Ideally instead of saying "use su", this script should say "su to a non-root admin user". It got me confused when it said to just use su, and then said "don't run this as root".

@mxcl
Copy link
Author

mxcl commented Feb 21, 2012

I'll remove the su, bit. Since apparently people don't realise what it means. Nobody understands unix anymore.

@nhooey
Copy link

nhooey commented Feb 21, 2012

I understand Unix and it confused me.

The script says:

If you still want to use this script set your user to be an Administrator in System Preferences or `su'.

It should be more specific and say to su as an administrator user. I figured that root was effectively an administrator, because I'm new to MacOS. The language just isn't precise.

@mxcl
Copy link
Author

mxcl commented Feb 21, 2012

I have amended it as you suggested. Thanks.

@duksis
Copy link

duksis commented Jan 4, 2013

Link to wrong url -> new url raw.github.com/mxcl/homebrew/go

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

@sdaitzman
Copy link

sdaitzman commented Oct 7, 2014

Broken link D:

Copy link

ghost commented Oct 27, 2014

@GraniteConsultingReviews

Broken link

@sameer333
Copy link

sameer333 commented Apr 18, 2018

use command
adduser bob
su - bob
and then run
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment