ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Mac OS 에 jq 설치하기
    HOWTO 2018. 11. 28. 17:12

    jq 는 command line 으로 json 을 컨트롤 할 수 있게 해주는 도구인데 mac os 에 설치하려고 하니 자꾸 아래와 같은 메세지가 보이면서 설치가 이뤄지지 않았다. 


    ➜  .ssh brew install jq

    Updating Homebrew...

    ==> Auto-updated Homebrew!

    Updated 1 tap (homebrew/core).

    ==> Updated Formulae

    swiftlint                                                                   vaulted


    Error: The following directories are not writable by your user:

    /usr/local/share/man/man3

    /usr/local/share/man/man5

    /usr/local/share/man/man7


    You should change the ownership of these directories to your user.

    sudo chown -R $(whoami) /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7


    좀 찾아보니까 mac os 가 업그레이드 되면서 /usr/local 폴더 권한이 변경 되었다고 한다. 

    그래서 폴더 권한을 변경하려고 했더니.. ㅠㅠ


    ➜  ~ sudo chown -R $(whoami) /usr/local

    chown: /usr/local: Operation not permitted


    sudo su 로 root 스위칭 후 커맨드를 실행했는데 동일한 에러가 발생한다. 


    sh-3.2# chown -R $(whoami):wheel /usr/local

    chown: /usr/local: Operation not permitted


    혹시 몰라서 brew install 한번 해봤더니 동일한 경고 ㅠㅠ


    sh-3.2# brew install jq

    Error: Running Homebrew as root is extremely dangerous and no longer supported.

    As Homebrew does not drop privileges on installation you would be giving all

    build scripts full access to your system.


    다시 원래 사용하던 사용자 계정으로 brew install 했더니 조금 다른 에러가 떨어졌다. (기쁨)


    ➜  ~ brew install jq

    Error: /usr/local/Cellar is not writable. You should change the

    ownership and permissions of /usr/local/Cellar back to your

    user account:

      sudo chown -R $(whoami) /usr/local/Cellar

    Error: The following directories are not writable by your user:

    /usr/local/Cellar

    /usr/local/Homebrew

    /usr/local/bin

    /usr/local/etc

    /usr/local/etc/bash_completion.d

    /usr/local/include

    /usr/local/lib

    /usr/local/lib/pkgconfig

    /usr/local/lib/python3.7/site-packages

    /usr/local/opt

    /usr/local/share

    /usr/local/share/doc

    /usr/local/share/info

    /usr/local/share/man

    /usr/local/share/man/man1

    /usr/local/share/man/man3

    /usr/local/share/man/man5

    /usr/local/share/man/man7

    /usr/local/share/zsh

    /usr/local/share/zsh/site-functions

    /usr/local/var/homebrew/linked

    /usr/local/var/homebrew/locks


    You should change the ownership of these directories to your user.

      sudo chown -R $(whoami) /usr/local/Cellar /usr/local/Homebrew /usr/local/bin /usr/local/etc /usr/local/etc/bash_completion.d /usr/local/include /usr/local/lib /usr/local/lib/pkgconfig /usr/local/lib/python3.7/site-packages /usr/local/opt /usr/local/share /usr/local/share/doc /usr/local/share/info /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew/linked /usr/local/var/homebrew/locks


    일단 시키는대로 /usr/local/Cellar 권한을 변경해주고 다시 설치했더니 /usr/local/Homebrew 디렉토리 권한도 변경해주라고 한다. 


    ➜  ~ sudo chown -R $(whoami) /usr/local/Cellar

    Password:


    ➜  ~ brew install jq

    Error: /usr/local/Homebrew is not writable. You should change the

    ownership and permissions of /usr/local/Homebrew back to your

    user account:

      sudo chown -R $(whoami) /usr/local/Homebrew

    Error: The following directories are not writable by your user:

    /usr/local/Homebrew

    /usr/local/bin

    /usr/local/etc

    /usr/local/etc/bash_completion.d

    /usr/local/include

    /usr/local/lib

    /usr/local/lib/pkgconfig

    /usr/local/lib/python3.7/site-packages

    /usr/local/opt

    /usr/local/share

    /usr/local/share/doc

    /usr/local/share/info

    /usr/local/share/man

    /usr/local/share/man/man1

    /usr/local/share/man/man3

    /usr/local/share/man/man5

    /usr/local/share/man/man7

    /usr/local/share/zsh

    /usr/local/share/zsh/site-functions

    /usr/local/var/homebrew/linked

    /usr/local/var/homebrew/locks


    시킨대로 /usr/local/Homebrew 디렉토리 권한 변경하고 다시 설치했더니 성공 !


    ➜  ~ sudo chown -R $(whoami) /usr/local/Homebrew

    ➜  ~ brew install jq

    ==> Installing dependencies for jq: oniguruma

    ==> Installing jq dependency: oniguruma

    ==> Downloading https://homebrew.bintray.com/bottles/oniguruma-6.9.0.mojave.bottle.tar.gz

    ######################################################################## 100.0%

    ==> Pouring oniguruma-6.9.0.mojave.bottle.tar.gz

    🍺  /usr/local/Cellar/oniguruma/6.9.0: 17 files, 1.3MB

    ==> Installing jq

    ==> Downloading https://homebrew.bintray.com/bottles/jq-1.6.mojave.bottle.1.tar.gz

    ######################################################################## 100.0%

    ==> Pouring jq-1.6.mojave.bottle.1.tar.gz

    🍺  /usr/local/Cellar/jq/1.6: 18 files, 1MB



    반응형

    댓글

Designed by Tistory.