{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/42987","labels_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42987/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42987/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42987/events","html_url":"https://github.com/Homebrew/homebrew/issues/42987","id":101233014,"number":42987,"title":"Homebrew clean and re-install problem on OSX 10.10 Yosemite","user":{"login":"jcpan1977","id":3595303,"avatar_url":"https://avatars.githubusercontent.com/u/3595303?v=3","gravatar_id":"","url":"https://api.github.com/users/jcpan1977","html_url":"https://github.com/jcpan1977","followers_url":"https://api.github.com/users/jcpan1977/followers","following_url":"https://api.github.com/users/jcpan1977/following{/other_user}","gists_url":"https://api.github.com/users/jcpan1977/gists{/gist_id}","starred_url":"https://api.github.com/users/jcpan1977/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcpan1977/subscriptions","organizations_url":"https://api.github.com/users/jcpan1977/orgs","repos_url":"https://api.github.com/users/jcpan1977/repos","events_url":"https://api.github.com/users/jcpan1977/events{/privacy}","received_events_url":"https://api.github.com/users/jcpan1977/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-16T04:20:40Z","updated_at":"2015-08-18T16:58:44Z","closed_at":null,"body":"I had Homebrew previously installed but broken after checking brew doctor, like below: \r\n```\r\njimmy$ brew doctor\r\n/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory\r\n/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0\r\n```\r\n\r\nThen, I tried to cleanup brew but seems didn't work either:\r\n```\r\njimmy$ sudo rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup\r\n/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory\r\n/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0\r\n\r\n So, I would like to reinstall. Permission error occurs when 'git reset --hard origin/master' runs.\r\n\r\njimmy$ ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\r\n==> This script will install:\r\n/usr/local/bin/brew\r\n/usr/local/Library/...\r\n/usr/local/share/man/man1/brew.1\r\n\r\nPress RETURN to continue or any other key to abort\r\n==> Downloading and installing Homebrew...\r\nremote: Counting objects: 3706, done.\r\nremote: Compressing objects: 100% (3541/3541), done.\r\nremote: Total 3706 (delta 37), reused 498 (delta 26), pack-reused 0\r\nReceiving objects: 100% (3706/3706), 3.06 MiB | 433.00 KiB/s, done.\r\nResolving deltas: 100% (37/37), done.\r\nFrom https://github.com/Homebrew/homebrew\r\n * [new branch]      master     -> origin/master\r\nerror: unable to unlink old 'Library/Aliases/0mq' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/4store' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/Secret Rabbit Code' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/actor-framework (Permission denied)\r\nerror: unable to create symlink Library/Aliases/adwaita-icon-theme (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/ag' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/alut' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/android' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/apache-activemq' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/apache-fop' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/atlassian-cli (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/aws-as' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/aws-mon' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/awsebcli (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/beanstalkd' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/bjam' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/blazegraph (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/boehmgc' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/boost-jam' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/boot2docker-cli (Permission denied)\r\nerror: unable to create symlink Library/Aliases/brightness (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/bzr' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/cmark (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/cowthink' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/cpanm' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/csvfix (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/ctags-exuberant' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/db' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/dbus' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/dejagnu' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/docker-compose (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/eyeD3' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/fastcgi' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/fishfish' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/fluidsynth' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/gearmand' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/git-tig (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/gnu-scientific-library' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/golang (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/google-go' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/gperftools' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/gpg' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/gpg2' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/gs' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/gtk' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/gtypist' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/hashdeep' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/heroku' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/hg' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/htop' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/hudson' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/ipsum' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/jocr' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/kotlin (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/lcms' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/lcms2' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/leg' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libcryptopp' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libgd' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libgeoip' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/libgme (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libjpeg' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libjpeg-turbo' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libjpg' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/liblabjackusb' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libmad' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libmcrypt' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libnettle' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/liboggz' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libqrencode' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libtag' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/libtasn' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/libtcnative (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/littlecms' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/mbedtls (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/mc' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/mdocml (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/mediainfo' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/mongo' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/mosh' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/mp4box' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/mpich' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/myrepos (Permission denied)\r\nerror: unable to create symlink Library/Aliases/nim (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/node.js' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/nodejs' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/npm' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/nsis' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/o-caml' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/ocio' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/offlineimap' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/ooc' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/openmpi' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/openocd' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/openscenegraph (Permission denied)\r\nerror: unable to create symlink Library/Aliases/pcre1 (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/pgrep' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/pipeviewer' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/pkgconfig' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/pkill' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/pocketsphinx' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/postgres' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/pt (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/qt4' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/rtl-sdr (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/shell-fm' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/slang' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/sonarqube (Permission denied)\r\nerror: unable to create symlink Library/Aliases/speedtest-cli (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/sphinxbase' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/sqlite3' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/stax-sdk' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/style' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/svn' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/tinyfugue' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/twemproxy (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/twolame' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/unix2dos' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/usb-multiplex-daemon' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/vid.stab (Permission denied)\r\nerror: unable to create symlink Library/Aliases/wolfssl (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/wxwidgets' (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/xmlsec1' (Permission denied)\r\nerror: unable to create symlink Library/Aliases/yubico-pam (Permission denied)\r\nerror: unable to create symlink Library/Aliases/yubikey-personalization (Permission denied)\r\nerror: unable to unlink old 'Library/Aliases/zmq' (Permission denied)\r\nerror: unable to unlink old 'Library/Contributions/brew_bash_completion.sh' (Permission denied)\r\nerror: unable to unlink old 'Library/Contributions/brew_zsh_completion.zsh' (Permission denied)\r\nerror: unable to create file Library/Contributions/example-formula.rb (Permission denied)\r\nerror: unable to create symlink Library/ENV/3.2.6 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.2 (Permission denied)\r\nerror: unable to create file Library/ENV/4.3/ant (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/apr-1-config' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/bsdmake' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/c++' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/c89' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/c99' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/cc' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/clang' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/clang++' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/cpp' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/g++' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/g++-4.2' (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/g++-4.3 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/g++-4.4 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/g++-4.5 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/g++-4.6 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/g++-4.7 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/g++-4.8 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/g++-4.9 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/g++-5 (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/gcc' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/gcc-4.2' (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/gcc-4.3 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/gcc-4.4 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/gcc-4.5 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/gcc-4.6 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/gcc-4.7 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/gcc-4.8 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/gcc-4.9 (Permission denied)\r\nerror: unable to create symlink Library/ENV/4.3/gcc-5 (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/git' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/gmake' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/i686-apple-darwin11-llvm-g++-4.2' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/i686-apple-darwin11-llvm-gcc-4.2' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/ld' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/llvm-g++' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/llvm-g++-4.2' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/llvm-gcc' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/llvm-gcc-4.2' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/make' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/mig' (Permission denied)\r\nerror: unable to create file Library/ENV/4.3/pod2man (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/sed' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/svn' (Permission denied)\r\nerror: unable to unlink old 'Library/ENV/4.3/xcrun' (Permission denied)\r\nfatal: cannot create directory at 'Library/ENV/pkgconfig/10.10': Permission denied\r\nFailed during: git reset --hard origin/master"},"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments/132278115","html_url":"https://github.com/Homebrew/homebrew/issues/42987#issuecomment-132278115","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42987","id":132278115,"user":{"login":"DomT4","id":6998367,"avatar_url":"https://avatars.githubusercontent.com/u/6998367?v=3","gravatar_id":"","url":"https://api.github.com/users/DomT4","html_url":"https://github.com/DomT4","followers_url":"https://api.github.com/users/DomT4/followers","following_url":"https://api.github.com/users/DomT4/following{/other_user}","gists_url":"https://api.github.com/users/DomT4/gists{/gist_id}","starred_url":"https://api.github.com/users/DomT4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DomT4/subscriptions","organizations_url":"https://api.github.com/users/DomT4/orgs","repos_url":"https://api.github.com/users/DomT4/repos","events_url":"https://api.github.com/users/DomT4/events{/privacy}","received_events_url":"https://api.github.com/users/DomT4/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T16:58:43Z","updated_at":"2015-08-18T16:58:43Z","body":"Do the above `chown` and then use [this script](https://github.com/Homebrew/install/blob/master/uninstall)."}}