Search code examples
activerecordhomebrewfreetdstiny-tds

Permissions error for homebrew 'brew update' on linux


I've got a permission error with Homebrew ported to linux via this handy how-to: http://blog.frameos.org/2010/11/10/mac-homebrew-ported-to-linux/comment-page-1/#comment-2208

I’ve got the same problem:

>  $ brew update –verbose
> 
>  git checkout -q master  fatal: Unable to create
> ‘/opt/homebrew/.git/index.lock’: Permission denied  Error: Failure
> while executing: git checkout -q master

Tried changing the file permission on the ‘index’ file, no luck. My final goal is to be able to install freetds and tinytds on my Ubuntu server (brew install freetds) so if there's another way to do so please lemme know!


Solution

  • Sorry, the small tutorial was horribly broken...

    In a nutshell:

    sudo apt-get install build-essential
    sudo mkdir /opt/homebrew
    sudo chown `whoami` -R /opt/homebrew
    git clone git://github.com/rubiojr/homebrew.git /opt/homebrew
    

    Looks like you need to fix permissions when running with an unprivileged user?

    chown -R `whoami` /opt/homebrew
    

    Let me know if that helps.