我正在尝试修复我对OSX Homebrew的权限,但我还是得到了
Error: Permission denied - /usr/local/opt
这是我到目前为止所尝试的内容。
我按照How to fix homebrew permissions?的说明进行操作,建议这样做:
sudo chown -R "$USER":admin /usr/local
sudo chown -R "$USER":admin /Library/Caches/Homebrew
sudo chown -R $USER:admin /Library/Caches/Homebrew
sudo chown -R `whoami` /usr/local
我还运行了这个Ruby脚本:https://gist.github.com/rpavlik/768518像这样:
ruby -e "$(curl -fsSL https://gist.github.com/raw/768518/fix_homebrew.rb)
从http://mascarenhas.us/blog/2013/05/25/osx-tip-fix-permissions-issue-during-homebrew-update/开始,我做到了这一点:
sudo chgrp -R admin /usr/local
sudo chmod -R g+w /usr/local
但无论我做什么,当我尝试运行时
MacBookPro:~ pjs$ brew link youtube-dl
我得到了
Error: Permission denied - /usr/local/opt
链接任何其他公式也是如此。
以下是我/ usr / local的权限:
MacBookPro: /usr/local pjs$ ls -lah
total 104
drwxrwxr-x 26 pjs admin 884B Aug 11 10:34 .
drwxr-xr-x@ 13 root wheel 442B Jul 21 17:12 ..
drwxrwxr-x 13 pjs admin 442B Aug 26 13:42 .git
-rw-rw-r-- 1 pjs admin 448B Aug 11 10:34 .gitignore
-rw-rw-r-- 1 pjs admin 296B Jul 30 15:45 .yardopts
-rw-rw-r-- 1 pjs admin 3.1K May 15 15:52 CODEOFCONDUCT.md
-rw-rw-r-- 1 pjs admin 1.1K Oct 30 2014 CONTRIBUTING.md
drwxrwxr-x 96 pjs admin 3.2K Aug 18 13:20 Cellar
drwxrwxr-x 3 pjs admin 102B Jul 17 04:17 Frameworks
-rw-rw-r-- 1 pjs admin 1.2K Jan 20 2015 LICENSE.txt
d-wx-wx-wx 11 pjs admin 374B Aug 25 23:37 Library
d-wx-wx-wx 3 pjs admin 102B Feb 1 2015 Qt
-rw-rw-r-- 1 pjs admin 2.3K Aug 3 01:26 README.md
-rw-rw-r-- 1 pjs admin 23K May 15 15:52 SUPPORTERS.md
drwxrwxr-x 454 pjs admin 15K Aug 26 13:42 bin
d-wx-wx-wx 17 pjs admin 578B Aug 6 01:03 etc
d-wx-wx-wx 9 pjs admin 306B Feb 1 2015 git
d-wx-wx-wx 98 pjs admin 3.3K Aug 25 23:36 include
d-wx-wx-wx 276 pjs admin 9.2K Aug 25 23:36 lib
d-wx-wx-wx 4 pjs admin 136B Feb 1 2015 libexec
d-wx-wx-wx 98 pjs admin 3.3K Aug 26 13:42 opt
--wx-wx-wx 1 pjs admin 88B May 6 2013 prince
drwxrwxr-x 4 pjs admin 136B Aug 6 01:03 sbin
d-wx-wx-wx 42 pjs admin 1.4K Aug 26 13:42 share
d-wx-wx-wx 5 pjs admin 170B Jul 21 17:43 texlive
d-wx-wx-wx 6 pjs admin 204B Aug 6 01:03 var
这是我对/ usr / local / opt:
的权限MacBookPro: /usr/local/opt pjs$ ls -lah
total 768
d-wx-wx-wx 98 pjs admin 3.3K Aug 26 13:42 .
drwxrwxr-x 26 pjs admin 884B Aug 11 10:34 ..
lrwxr-xr-x 1 pjs admin 25B May 16 2014 aspell -> ../Cellar/aspell/0.60.6.1
lrwxr-xr-x 1 pjs admin 23B Aug 5 22:25 autoconf -> ../Cellar/autoconf/2.69
lrwxr-xr-x 1 pjs admin 25B May 3 2014 autojump -> ../Cellar/autojump/21.6.9
lrwxr-xr-x 1 pjs admin 23B Aug 5 22:25 automake -> ../Cellar/automake/1.15
lrwxr-xr-x 1 pjs admin 22B Jun 23 17:41 bdw-gc -> ../Cellar/bdw-gc/7.4.2
lrwxr-xr-x 1 pjs admin 28B Aug 19 01:34 berkeley-db -> ../Cellar/berkeley-db/6.1.26
lrwxr-xr-x 1 pjs admin 26B Aug 4 11:30 brew-cask -> ../Cellar/brew-cask/0.56.0
lrwxr-xr-x 1 pjs admin 22B Aug 4 11:30 cask -> ../Cellar/cask/0.7.2_1
lrwxr-xr-x 1 pjs admin 21B Aug 19 01:50 cmake -> ../Cellar/cmake/3.3.1
lrwxr-xr-x 1 pjs admin 22B Sep 27 2014 cmatrix -> ../Cellar/cmatrix/1.2a
lrwxr-xr-x 1 pjs admin 20B Jul 20 00:31 cmus -> ../Cellar/cmus/2.7.1
lrwxr-xr-x 1 pjs admin 22B Aug 25 23:25 d-bus -> ../Cellar/d-bus/1.8.20
lrwxr-xr-x 1 pjs admin 21B Jul 31 20:59 dict -> ../Cellar/dict/1.12.1
lrwxr-xr-x 1 pjs admin 24B Aug 6 01:03 dovecot -> ../Cellar/dovecot/2.2.18
lrwxr-xr-x 1 pjs admin 20B Aug 10 16:59 emacs -> ../Cellar/emacs/24.5
lrwxr-xr-x 1 pjs admin 19B Aug 21 2014 faac -> ../Cellar/faac/1.28
lrwxr-xr-x 1 pjs admin 19B May 16 2014 faad2 -> ../Cellar/faad2/2.7
lrwxr-xr-x 1 pjs admin 20B Jul 1 23:50 fasd -> ../Cellar/fasd/1.0.1
lrwxr-xr-x 1 pjs admin 24B Aug 18 09:59 ffmpeg -> ../Cellar/ffmpeg/2.7.2_1
lrwxr-xr-x 1 pjs admin 20B Dec 18 2014 flac -> ../Cellar/flac/1.3.1
lrwxr-xr-x 1 pjs admin 27B May 9 2014 fontconfig -> ../Cellar/fontconfig/2.11.0
lrwxr-xr-x 1 pjs admin 24B Jul 17 04:44 freetype -> ../Cellar/freetype/2.6_1
lrwxr-xr-x 1 pjs admin 19B Oct 30 2014 gdbm -> ../Cellar/gdbm/1.11
lrwxr-xr-x 1 pjs admin 26B Jul 21 01:40 gettext -> ../Cellar/gettext/0.19.5.1
lrwxr-xr-x 1 pjs admin 21B Jul 31 22:30 glib -> ../Cellar/glib/2.44.1
lrwxr-xr-x 1 pjs admin 22B Aug 5 22:25 gmime -> ../Cellar/gmime/2.6.20
lrwxr-xr-x 1 pjs admin 20B May 16 2014 gmp -> ../Cellar/gmp/6.0.0a
lrwxr-xr-x 1 pjs admin 26B May 17 06:13 gnu-typist -> ../Cellar/gnu-typist/2.9.5
lrwxr-xr-x 1 pjs admin 22B Aug 18 13:20 gnupg -> ../Cellar/gnupg/1.4.19
lrwxr-xr-x 1 pjs admin 25B Aug 18 09:59 gnutls -> ../Cellar/gnutls/3.3.17.1
lrwxr-xr-x 1 pjs admin 26B Aug 6 03:27 html2text -> ../Cellar/html2text/1.3.2a
lrwxr-xr-x 1 pjs admin 24B Jul 17 04:31 hunspell -> ../Cellar/hunspell/1.3.3
lrwxr-xr-x 1 pjs admin 20B May 17 06:19 icu4c -> ../Cellar/icu4c/55.1
lrwxr-xr-x 1 pjs admin 30B Jul 28 16:12 imagemagick -> ../Cellar/imagemagick/6.9.1-10
lrwxr-xr-x 1 pjs admin 21B Aug 26 00:35 isync -> ../Cellar/isync/1.2.0
lrwxr-xr-x 1 pjs admin 21B Dec 18 2014 jansson -> ../Cellar/jansson/2.7
lrwxr-xr-x 1 pjs admin 17B Jul 17 04:44 jpeg -> ../Cellar/jpeg/8d
lrwxr-xr-x 1 pjs admin 21B Jan 20 2015 json-c -> ../Cellar/json-c/0.12
lrwxr-xr-x 1 pjs admin 21B May 16 2014 lame -> ../Cellar/lame/3.99.5
lrwxr-xr-x 1 pjs admin 21B May 16 2014 libao -> ../Cellar/libao/1.2.0
lrwxr-xr-x 1 pjs admin 22B May 16 2014 libcue -> ../Cellar/libcue/1.4.0
lrwxr-xr-x 1 pjs admin 23B Jul 31 22:29 libffi -> ../Cellar/libffi/3.0.13
lrwxr-xr-x 1 pjs admin 27B Jul 28 16:12 libgcrypt -> ../Cellar/libgcrypt/1.6.3_1
lrwxr-xr-x 1 pjs admin 27B Apr 14 07:57 libgpg-error -> ../Cellar/libgpg-error/1.19
lrwxr-xr-x 1 pjs admin 22B Jul 31 20:58 libmaa -> ../Cellar/libmaa/1.3.2
lrwxr-xr-x 1 pjs admin 22B Aug 30 2014 libogg -> ../Cellar/libogg/1.3.2
lrwxr-xr-x 1 pjs admin 23B Jul 28 16:12 libpng -> ../Cellar/libpng/1.6.18
lrwxr-xr-x 1 pjs admin 22B May 17 06:13 libtasn1 -> ../Cellar/libtasn1/4.5
lrwxr-xr-x 1 pjs admin 23B Jul 17 04:44 libtiff -> ../Cellar/libtiff/4.0.4
lrwxr-xr-x 1 pjs admin 23B Jul 17 04:44 libtool -> ../Cellar/libtool/2.4.6
lrwxr-xr-x 1 pjs admin 28B Apr 14 07:57 libvo-aacenc -> ../Cellar/libvo-aacenc/0.1.3
lrwxr-xr-x 1 pjs admin 25B Apr 14 07:57 libvorbis -> ../Cellar/libvorbis/1.3.5
lrwxr-xr-x 1 pjs admin 22B Jul 13 23:43 libvpx -> ../Cellar/libvpx/1.4.0
lrwxr-xr-x 1 pjs admin 25B Jan 20 2015 libyaml -> ../Cellar/libyaml/0.1.6_1
lrwxr-xr-x 1 pjs admin 25B May 12 2014 lynx -> ../Cellar/lynx/2.8.8rel.2
lrwxr-xr-x 1 pjs admin 21B May 16 2014 mad -> ../Cellar/mad/0.15.1b
lrwxr-xr-x 1 pjs admin 26B Oct 18 2014 makedepend -> ../Cellar/makedepend/1.0.5
lrwxr-xr-x 1 pjs admin 23B Aug 2 03:05 mercurial -> ../Cellar/mercurial/3.5
lrwxr-xr-x 1 pjs admin 21B Jul 31 03:19 most -> ../Cellar/most/5.0.0a
lrwxr-xr-x 1 pjs admin 21B May 16 2014 mp4v2 -> ../Cellar/mp4v2/2.0.0
lrwxr-xr-x 1 pjs admin 21B Aug 5 22:26 msmtp -> ../Cellar/msmtp/1.6.2
lrwxr-xr-x 1 pjs admin 17B Aug 10 14:40 mu -> ../Cellar/mu/HEAD
lrwxr-xr-x 1 pjs admin 22B May 16 2014 nettle -> ../Cellar/nettle/2.7.1
lrwxr-xr-x 1 pjs admin 21B Jul 17 04:17 node -> ../Cellar/node/0.12.7
lrwxr-xr-x 1 pjs admin 24B Aug 6 02:35 notmuch -> ../Cellar/notmuch/0.20.2
lrwxr-xr-x 1 pjs admin 28B Aug 5 20:23 offline-imap -> ../Cellar/offline-imap/6.5.7
lrwxr-xr-x 1 pjs admin 26B Aug 5 22:27 openssl -> ../Cellar/openssl/1.0.2d_1
lrwxr-xr-x 1 pjs admin 25B Jul 20 23:38 pandoc -> ../Cellar/pandoc/1.13.2.1
lrwxr-xr-x 1 pjs admin 19B Jul 19 18:58 pcre -> ../Cellar/pcre/8.37
lrwxr-xr-x 1 pjs admin 21B Sep 25 2014 pdfjam -> ../Cellar/pdfjam/2.08
lrwxr-xr-x 1 pjs admin 21B Jul 31 20:55 perl -> ../Cellar/perl/5.22.0
lrwxr-xr-x 1 pjs admin 29B Oct 12 2014 pianobar -> ../Cellar/pianobar/2014.09.28
lrwxr-xr-x 1 pjs admin 25B May 16 2014 pkg-config -> ../Cellar/pkg-config/0.28
lrwxr-xr-x 1 pjs admin 25B Jul 17 04:17 python -> ../Cellar/python/2.7.10_2
lrwxr-xr-x 1 pjs admin 24B Oct 30 2014 readline -> ../Cellar/readline/6.3.8
lrwxr-xr-x 1 pjs admin 23B Jun 4 02:50 rmtrash -> ../Cellar/rmtrash/0.3.3
lrwxr-xr-x 1 pjs admin 20B Aug 20 12:51 ruby -> ../Cellar/ruby/2.2.3
lrwxr-xr-x 1 pjs admin 22B Jul 31 03:19 s-lang -> ../Cellar/s-lang/2.3.0
lrwxr-xr-x 1 pjs admin 30B Aug 11 10:34 screenbrightness -> ../Cellar/screenbrightness/1.2
lrwxr-xr-x 1 pjs admin 29B Jul 31 22:30 sdcv -> ../Cellar/sdcv/0.5-2013-09-10
lrwxr-xr-x 1 pjs admin 25B Aug 11 10:34 sqlite -> ../Cellar/sqlite/3.8.11.1
lrwxr-xr-x 1 pjs admin 27B May 3 2014 ssh-copy-id -> ../Cellar/ssh-copy-id/6.6p1
lrwxr-xr-x 1 pjs admin 23B Aug 13 01:46 surfraw -> ../Cellar/surfraw/2.2.9
lrwxr-xr-x 1 pjs admin 22B Aug 6 02:35 talloc -> ../Cellar/talloc/2.1.2
lrwxr-xr-x 1 pjs admin 24B Aug 21 2014 texi2html -> ../Cellar/texi2html/1.82
lrwxr-xr-x 1 pjs admin 36B Jul 19 18:58 the_silver_searcher -> ../Cellar/the_silver_searcher/0.30.0
lrwxr-xr-x 1 pjs admin 19B Jun 23 17:41 w3m -> ../Cellar/w3m/0.5.3
lrwxr-xr-x 1 pjs admin 21B Jul 18 2014 wdiff -> ../Cellar/wdiff/1.2.2
lrwxr-xr-x 1 pjs admin 21B Apr 14 07:57 wget -> ../Cellar/wget/1.16.3
lrwxr-xr-x 1 pjs admin 21B Jul 21 16:04 wordnet -> ../Cellar/wordnet/3.1
lrwxr-xr-x 1 pjs admin 20B Aug 18 09:56 x264 -> ../Cellar/x264/r2555
lrwxr-xr-x 1 pjs admin 23B Aug 5 22:25 xapian -> ../Cellar/xapian/1.2.19
lrwxr-xr-x 1 pjs admin 20B Jul 8 10:53 xvid -> ../Cellar/xvid/1.3.4
lrwxr-xr-x 1 pjs admin 18B Apr 14 07:57 xz -> ../Cellar/xz/5.2.1
lrwxr-xr-x 1 pjs admin 20B Aug 21 2014 yasm -> ../Cellar/yasm/1.3.0
lrwxr-xr-x 1 pjs admin 31B Aug 26 13:42 youtube-dl -> ../Cellar/youtube-dl/2015.08.23
如何修复自制软件的权限?